-3

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
  • 10,560
  • 2
  • 41
  • 69
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
  • 399
  • 6
  • 23