prevent form submission on onsubmit function calls 1

prevent form submission on onsubmit function calls

returning false here won't be executed and the form will be submitted either way. You should also call preventDefault to prevent the default form action for Ajax form submissions.

function mySubmitFunction(e) {
  e.preventDefault();
  someBug();
  return false;
}

Get more references : https://stackoverflow.com/questions/3350247/how-to-prevent-form-from-being-submitted

Here is what the above code is Doing:
1. The form is submitted to the server.
2. The server processes the form and returns a response.
3. The response is displayed on the page.

Similar Posts