• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

Form validation using Javascript

Hi,

I'm writing an application consisting in multiple forms. When I move from to the other, I need to save the information to the database.

If I use a "Submit" button to submit the form, all the validation control are checked and the form is only submitted if everything is valid.

But if I want to do the same using 'form.submit()' in javascript, the form is submitted but no validation is performed and the data are sent without any validation.

Since I absolutely need to submit the form using Javascript, is there anyway to have the same behaviour as the "Submit" button ?
0
Raph74
Asked:
Raph74
1 Solution
 
tusharashahCommented:
Use Following JavaScript :

document.getElementById('btnSubmit').click();

-tushar
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now