javascript form preventdefault then submit code example
Example 1: javascript prevent form submit
<form name="foo" onsubmit="return false">
Example 2: prevent button form submit
<button type="button">Button</button>
<form name="foo" onsubmit="return false">
<button type="button">Button</button>