One way to stop form submission is to return false from your JavaScript function.
When the submit button is clicked, a validation function is called. I have a case i
Just use a simple button instead of a submit button. And call a JavaScript function to handle form submit:
button
Function within a script tag:
script
function submit_form() { if (conditions) { document.forms['myform'].submit(); } else { returnToPreviousPage(); } }
You can also try window.history.forward(-1);
window.history.forward(-1);