Form validation using Javascript

Posted on 2005-04-14
Last Modified: 2010-05-18

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 ?
Question by:Raph74
    1 Comment
    LVL 18

    Accepted Solution

    Use Following JavaScript :



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now