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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:16:10+00:00 2026-05-25T21:16:10+00:00

I have this form that submits to work.php . What I want to do

  • 0

I have this form that submits to work.php.

What I want to do is disable the submit button when the form is submitted, then re-enable it after 5 seconds or so, so I don’t get multiple posts.

How can I do this?

Also, if I press the enter key in one of the text boxes while the submit button is not clickable then it will redirect me to work.php which don’t want to happen.

 <form method="post" action="work.php">
        <strong>Message:</strong>
        <input type="text" id="message" name="message" class="message" />
        <input type="submit" id="submit" onClick="this.value='Processing form';this.disabled=true;if(Submitting()){this.form.submit()}else{this.value='Submit';this.disabled=false;}" value="Submit" />
</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-05-25T21:16:10+00:00Added an answer on May 25, 2026 at 9:16 pm

    You don’t need to worry about this. If the user spams the form submit in any way (clicking submit or hitting enter), only one complete request is sent to the server – every time the submit is triggered, it resets the POST and starts again.

    Do note that using JavaScript to stop this behaviour is pretty bad, considering it’s incredibly easy to disable JS and spam away, which is one of the reasons why browsers only allow one POST submission at a time.

    If you’re using AJAX (which you haven’t specified), then you should use @drrcknlsn’s answer.

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

Sidebar

Related Questions

I have a form that and after the user fills in this form, I
I have created a search form that I want to forward on submit. The
Okay, so I have this form that is set to preload a DB record
Please have a look at this form that I am trying to design with
I have a form that looks like this: class SampleForm(forms.Form): text = forms.CharField(max_length=100) In
I have a form that looks kind of like this: <div> <div class=contact> <h1>Person's
I have this java servlet that grabs information from a form, I need to
I have this function to edit all fields that come from the form and
I have a form that allows a user to import a spreadsheet. This spreadsheet
I have asp.net form that contains fields. When I access this window, my javascript

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.