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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:18:10+00:00 2026-05-13T15:18:10+00:00

It is jQuery . I have a signup form. At the domain textbox field,

  • 0

It is jQuery.

I have a signup form. At the domain textbox field, people fill in domain, then onblur Ajax call to registar API for validation on domain availability.

The validation may take up to 15 seconds depending on network speed.

In this waiting period, if user go to click submit button, how to block?

My idea is simple: Before any Ajax call finish loading, I don’t want to allow people to click submit.

I can think of a way, but I am not sure whether this is a good way. I need advice.

beforeSend: function(){
    $("#btnSubmit").attr("disabled", "disabled");
},

complete: function(){
    $("#btnSubmit").attr("disabled", "");
}

<input type="button" name="btnSubmit" id="btnSubmit" value="my button" />
  • 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-05-13T15:18:10+00:00Added an answer on May 13, 2026 at 3:18 pm

    Setting async to false might work but that might hang the browser completely for 15 seconds. Your best bet is to disable the submit element and prevent the submit in other ways using a variable where you store whether the validation is in process:

    var validating = false;
    
    $(function() {
    
        $('form').submit(function() {
            if(validating) return false;
            var button = $(this).find('input:submit, input:button');
    
            button.attr('disabled', 'disabled');
            validating = true;
    
            $.ajax({
                url: 'validator.php',
                data: $(this).serialize(),
                success: function() {
                    validating = false;
                    button.removeAttr('disabled');
                }
            });
        });
    });
    

    This way the user cannot submit the form in any other means. If you only disable the submit button, it might be possible to submit the form with the enter key (not sure about this). Using a variable which tells whether the validation is running is a sure way to prevent accidental submitting.

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

Sidebar

Related Questions

Built a simple JQuery/Ajax newsletter signup form, then went back after the fact to
does jquery have any plugin that prevents entering any input to a textbox that
I have jquery with class= modal i want to call that class when page
I have jQuery validation code for a form. However when I set ie9 to
I am using the jQuery Validation plugin to validate a signup form for my
I'm doing a simple jQuery form checker for a website. I have two forms
I am trying to create a javascript - jQuery form validator. I have an
I'm working on an email series signup form that needs to have a checkbox
I have a bit of jquery that is submitting a email sign up form
I'm working to integrate with the MailChimp API to submit a form via Ajax,

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.