how to cancel form submit in javascript code example
Example 1: javascript prevent form submit
<form name="foo" onsubmit="return false">
Example 2: how to submit a form in js
document.forms["myform"].submit();
<form name="foo" onsubmit="return false">
document.forms["myform"].submit();