> The best way to handle it is to add a return false in the onclick.
> Example:
>
> <script>
> function DoStuff() { alert('ajax stuff here'); }
> </script>
> <input type='submit' onClick='DoStuff(); return false;' />
He already is returning false from the submit handler.
> Or add the function to the onsubmit event handler, would work even
> better.
He already is calling the function from the submit handler:
$("#PromotionRequestForm").submit( function() {
promo("#PromotionRequestForm", "#promo")
//alert('clicked');
return false;
});
promo() calls ajaxSubmit(). That's all fine. His problem isn't that
the form submits normally in addition to the AJAX call, but that it
remains possible to make further submissions after the first.
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment