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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:26:45+00:00 2026-06-05T22:26:45+00:00

There are several threads on this here at SO but I didn’t find one

  • 0

There are several threads on this here at SO but I didn’t find one that deals specifically with the awesome jQuery Form plugin which I use extensively in my app.

I want the user to be able to click ‘submit’ only once — and disable the ‘submit’ button until Ajax has returned a JSON string on success.

My trial code goes something like this

$('#submit_button').live('click', function(e) {
e.preventDefault();

var options = {
    type:           'post',
    dataType:       'json',
    beforeSubmit:   function(){
                        $('#loading').show().fadeIn();
                        $('#submit_button').attr('disabled', 'disabled');
                    },
    success:        function(data) {
                            if (data.success === 3) {
                                $('#submit_button').hide();
                                $('#loading').hide();
                                $('#validation_message').html(data.message).fadeIn();
                                $('#submit_button').attr('enabled', 'enabled');
                            }
                    }
            }

$(this).closest('form').ajaxSubmit(options);
});

But this piles up “enabled” and “disabled” attributes in the <button>.

<button class="button" id="submit_button" disabled="disabled" enabled="enabled"> Post </button>

Do you have any suggestions on how to get this to work?

  • 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-05T22:26:49+00:00Added an answer on June 5, 2026 at 10:26 pm

    Instead of setting attribute “enabled” to “enabled”, you will want to unset the “disabled” attribute: $('#submit_button').attr('disabled', '');

    HTML does not have an “enabled” attribute for buttons, so the browser isn’t going to do anything with it – it considers it just a “junk” attribute. Setting and unsetting the “disabled” attribute is what you’re after.

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

Sidebar

Related Questions

There are several similar threads Q1 or Q2 to this one, but not exactly.
I'm stumped. There are several threads out there that reference a similar problem, but
There are several other questions about this topic that I have gone through, but
There are several variant questions on this on SO, but I did not find
I know there are several threads and posts regarding this issue in the internet
I know there are several threads asking similar questions - but I havent found
I've searched several threads and bug reports, but couldn't find a solution. I changed
I've found several threads on various sites vaguely related this, but no solid answers.
I know there is several threads on this topic. I see a lot of
Here is one of several sources that say ASP.NET defaults to single-threaded apartment, 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.