1👍
I found a simpler solution here.
** stack overflow: disable auto-submit on button click **
It explains that by html5 default a button is type=”submit”. The solution to the above problem is explained below.
<button type="button" onclick="select_all()">Select All</button>
0👍
You probably hate to unbind submit, then you can submit the form.
$('some_form').unbind('submit').submit()
This approach should cancel prevenDefault
so you can submit the form.
Source:stackexchange.com