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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:41:59+00:00 2026-06-14T18:41:59+00:00

In my form if you click Submit twice quickly enough I get two successful

  • 0

In my form if you click Submit twice quickly enough I get two successful form ajax posts. How can I stop duplicate posts?

From what I can tell

  1. User clicks submit
  2. Ajax post sent
  3. User clicks submit (completed and valid form)
  4. Ajax post sent
  5. Ajax response received
  6. Page refreshed with empty (new empty form – requires values)
  7. Ajax response received
  8. Page refreshed with empty (new empty form – requires values)

The form is sent twice, I create two items.

There are similarly named questions but they relate to disabling validation or disabling ajax. Ajax, jquery validation and server side validation (Post-Redirect-Get in MVC) are working just fine for me.

Just to be clear I’m using jQuery Mobile’s Ajax navigation so I’m not writing any ajax.

  • 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-14T18:42:01+00:00Added an answer on June 14, 2026 at 6:42 pm

    This is the solution I have now is:

    $(document).on('submit', "form", null, function (e) {
        $(this).find("input:submit")
        .attr('disabled', 'disabled')
        // the following is optional, arguably unnecessary
        .delay(2000)
        .queue(function (next) { $(this).removeAttr('disabled'); next(); });
    });
    

    (Updated to work in webkit)

    The delay is just in case something goes wrong. In reality the form should get replaced and the replacement will not be disabled.

    Better suggestions welcome.

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

Sidebar

Related Questions

about click and submit example below: <form action=url method=post> <input type=text id=input1/> <input type=submit
i have this form to serialize once i click the submit button, <form class=cashier_forms
I have a form which I want to submit upon button click which is
What I am trying to do is: When you click on a form submit
Is there ASP button that won't submit post form data. Whenever I click an
I have a form with a text area. Some people double-click on the submit
How can I use addEventListener() to assign a handler to an HTML form's Submit
Is there any way to when you click submit on a form, as each
I have some post form. On click submit button, turn to another page. I
I have simple registration form. Once all information entered, user click submit button and

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.