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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:15:55+00:00 2026-05-31T09:15:55+00:00

When the user submits an HTML form, I want to disable the form while

  • 0

When the user submits an HTML form, I want to disable the form while the server is processing it. I don’t want the user to type any additional text, nor do I want them to rapidly tap the submit button to send multiple requests. I tried doing this with Prototype JS:

$('formId').observe(
    'submit',
    function(event) {
        Event.element(event).disable();
    }
);

The form correctly gets disabled, but on the server side, I error_log out $_POST and find that it is completely empty. This problem only occurs when the form is disabled upon submission.

  • 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-31T09:15:56+00:00Added an answer on May 31, 2026 at 9:15 am

    If you disable the form, I think it will not submit / post your fields, because it’ll be diabled, What I do in that cases is disable the submit button, not the whole form.

    $('formId').observe(
        'submit',
        function(event) {
            $$("input[type='submit']").each(function(v) {v.disabled = true;})
        }
    );
    

    Take a look to this How can I unobtrusively disable submit buttons with Javascript and Prototype?

    UPDATE:

    But disabling the submit button is not enough. People can hit the
    enter key on a text input to submit the form. Using the submit button
    is not the only way to submit a form

    Then you can make a combination with this answer https://stackoverflow.com/a/9693667/1078487

    var already_submitted = false;
    
    $('formId').observe(
        'submit',
        function(e) {
            // disable input
            $$("input[type='submit']").each(function(v) {v.disabled = true;})
            if ( already_submitted ) {
                new Event(e).stop();
                return false;
            } else {
                already_submitted = true;
            }
        }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So the chain of events is: The user submits a form. During the processing
I currently have a html form submitting data to my database. The user submits
If a website user submits an HTML form with: (1) a post method; (2)
Ok, So I have a form that is on page 'index.html'. The user submits
I've created a login submit form in HTML but for some reason user/password autocompletion
I have an HTML page with a simple form. When the user clicks submit,
I have form where user submits field. Field can have letters, numbers, and punctuation.
After a user submits a form, how do you detect that the form has
I have situation like this: user submits form with action='/pay' in '/pay' I have
I want to run a particular block of PHP if the user submits a

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.