Wednesday, April 9, 2014

[Javascript] Way to prevent submitting forms if check submit button

I want stop the form submission if check the submit button,
The way is quite simple,
You can just add onsubmit="return false;" to form tab is already works.
<form id="fb_form" class="form-horizontal" role="form" onsubmit="return false;" >

Reference:
http://stackoverflow.com/questions/932653/how-to-prevent-buttons-from-submitting-forms

No comments :

Post a Comment