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
Lets say you have a form similar to this
ERASE ALL DATA
Here is the javascript for the confirmAction function
This one works on Firefox, Chrome, Internet Explorer(edge), Safari, etc.
If that is not the case let me know