-4

I want to validate my form using javascript before submitting it. I validated all fields successfully but my form is not getting submitted.

Just a student
  • 9,978
  • 2
  • 39
  • 64
darshana
  • 1
  • 3

1 Answers1

0

Pure Javascript

you can use the HTML DOM submit() function:

document.getElementById("myForm").submit();

Read more about the function here: https://www.w3schools.com/jsref/met_form_submit.asp

With Jquery

$("#myForm").submit(/* Callback */);

Read more about the jquery function in the documentation: https://api.jquery.com/submit/

Rishi
  • 389
  • 5
  • 23