how to stop a form submit in javascript weith if condition code example
Example: 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>