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 7716289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:35:55+00:00 2026-06-01T02:35:55+00:00

The form validation works fine, so if u leave the email input blank and

  • 0

The form validation works fine, so if u leave the email input blank and HIT submit ONCE, it will throw the error msg. BUT when u fill out the email [input] field, i had to HIT the “submitBtn” TWICE or sometimes even more to actually display the result.

so this is the script :

$('#RetrieveQuote2').validate({
    rules: {
        email: {
            required: true,
            email: true
        }
    },
    errorPlacement: function(error, element) {
        error.insertBefore(element);
    },

    submitHandler: function() {
        $('input#submitBtn').bind('click', function() {
            var content = $("input#email").val();
            if (content == "abc@abc.com") {
                $('.quotenotfound').show();
                return false;
            } else {
                $('form#RetrieveQuote2').submit();

                formValidationSubmitted = true;

                if (!$('#RetrieveQuote2').valid()) {
                    $('.errorMessage').show();
                }

                $("input#submitBtn").colorbox({
                    href: function() {
                        var url = $(this).parents('form').attr('action');
                        var ser = $(this).parents('form').serialize(); //alert(url+'?'+ser);
                        return url + '?' + ser;
                    },
                    innerWidth: "780",
                    innerHeight: "450",
                    iframe: true
                });
            } // end of else
        });
    } // end of submitHandler
});

And below is the HTML form :

<form name="RetrieveQuote2" id="RetrieveQuote2" action="overlays/quotelist.php" method="get">
  <fieldset class="cf">
    <legend>email</legend>
    <label>Your Email</label>
    <input type="text" name="email" id="email" value="" maxlength="25"/>
    <div class="submit">
      <input type="submit" name="RetrieveQuote" class="rqSubmitBtn" id="submitBtn" value="SUBMIT" />
    </div>
  </fieldset>
</form>
  • 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-01T02:35:57+00:00Added an answer on June 1, 2026 at 2:35 am

    The problem is that you are trying to add a handler to the submit button inside of your submit handler.

    So, on the first click, the validate handler is called (from the click handler that it adds automatically), and then your click handler is added, but not run. The second click, you add another click handler, and then the one you added the first time is called.

    The validate plugin should add the handler automatically for you.

    Remove $('input#submitBtn').bind('click', function() { around your submit handler contents.

    You also don’t need $('form#RetrieveQuote2').submit(); This will also happen automatically after the submit handler.

    Demo: http://jsfiddle.net/asrfV/

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

Sidebar

Related Questions

This is a form validation that will hide the submit button if the input
i have a jquery form validation in the master page and it works fine
I was writing a simple login form, everything works fine (validation etc.) but I
I've got a wpf form where validation works fine for single-field validation. I've got
I have written a few jquery functions for form validation. It works fine but
I have a form that calls on two separate models. My validation works correctly
I'm using the jQuery validation plugin from bassistance.de. It works fine. From <head> :
I have a problem with the scoped uniqueness validation in Rails. It works fine
I am verifying the email in database in form validation in CodeIgniter by using
I would like to perform form validation using JavaScript to check for input field

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.