Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:42:57+00:00 2026-06-01T04:42:57+00:00

I have a situation where validating a HTML form with jQuery Validation Plugin 1.9.0.

  • 0

I have a situation where validating a HTML form with jQuery Validation Plugin 1.9.0. (I’m using jQuery 1.6.4).
If the form is filled out correctly after the page is loaded the validation takes place on submit. The validation gives a success message, but it doesn’t trigger the submitHandler.
It only triggers the submitHandler if you press the submit button again.

I created a simulation on http://jsfiddle.net/peterph/Hv3xz/1/ to illustrate the problem.
Can anyone tell me how I can fix this problem?

<form method="post" id="form">
    <input id="E_Mail" name="E_mail" title="E_mail" required="required" /><br />
    <input class="submit" type="submit" value="Send"/>
</form>

<script>
    jQuery(function($) {
        $("#form").submit(function(e) {
            var $form = $(this);
            alert('Start Validation');
            $form.validate({
                debug: false,
                focusInvalid: false,
                onfocusout: false,
                onkeyup: false,
                onclick: false,
                rules:
                {
                    E_mail: {required:true, email:true },
                },
                success: function(label) {
                    alert('succes:' + label);
                },
                submitHandler: function(form){
                    alert('start submitHandler');
                    postContent('test');
                    alert('end submitHandler');
                },
                invalidHandler: function(form, validator) {
                    alert('invalidHandler');
                },
            }).form();
            alert('end Validation');
            e.preventDefault();
        });
    });

    function postContent(postData){
        alert('postcontent: ' + postData);
    }
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:42:59+00:00Added an answer on June 1, 2026 at 4:42 am

    validate is not called until you submit the form. The first time you hit submit, validate has not been applied to the form. The second time it has.

    You should move the call to validate outside of the submit handler:

    jQuery(function ($) {
        $("#form").validate({
            debug: false,
            focusInvalid: false,
            onfocusout: false,
            onkeyup: false,
            onclick: false,
            rules:
            {
                E_mail: {required:true, email:true },
            },
            success: function(label) {
                alert('succes:' + label);
            },
            submitHandler: function(form){
                alert('start submitHandler');
                postContent('test');
                alert('end submitHandler');
            },
            invalidHandler: function(form, validator) {
                alert('invalidHandler');
            },
        });
    });
    

    And everything should work fine.

    Updated Example: http://jsfiddle.net/8r47E/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where I am using wpf data binding and validation using
I'm using JPA 2.0/Hibernate validation to validate my models. I now have a situation
I have situation like this: user submits form with action='/pay' in '/pay' I have
I have a php file that contains a HTML form, then PHP logic, then
Here is my situation. I have a web page for users to create their
I'm using NHibernate as my ORM. I have a situation where I have some
I have a situation where I am sending data to a Controller via jQuery
My Situation I have a list of items(surveys) displayed on my home page. When
I have a situation in ASP.NET MVC 2 where I have a form whose
Interesting situation. I have a Html.Textbox() that I render from a view as follows:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.