hwo to prevent defualt on form submitting js code example
Example 1: js stop form submit
<button type="submit" onclick="submitButtonClick(event)">Submit</button>
<script>
function submitButtonClick(event) {
event.preventDefault();
//other stuff you want to do instead...
}
</script>
Example 2: js preventdefault
function(event) {
event.preventDefault();
}
Example 3: javascript prevent form submit
<form name="foo" onsubmit="return false">