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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:57:26+00:00 2026-06-08T09:57:26+00:00

I have a button as such: <input type=submit id=submit value=Save /> Within jQuery I

  • 0

I have a button as such:

<input type="submit" id="submit" value="Save" />

Within jQuery I am using the following, but it still allows for double-clicks:

<script type="text/javascript">

$(document).ready(function () {

    $("#submit").one('click', function (event) {  

Any idea on how I can prevent double-click?

  • 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-08T09:57:27+00:00Added an answer on June 8, 2026 at 9:57 am

    jQuery’s one() will fire the attached event handler once for each element bound, and then remove the event handler.

    If for some reason that doesn’t fulfill the requirements, one could also disable the button entirely after it has been clicked.

    $(document).ready(function () {
         $("#submit").one('click', function (event) {  
               event.preventDefault();
               //do something
               $(this).prop('disabled', true);
         });
    });
    

    It should be noted that using the ID submit can cause issues, as it overwrites the form.submit function with a reference to that element.

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

Sidebar

Related Questions

I have the following jQuery/ajax script: jQuery(input.button).click(function(){ jQuery.ajax({ url: 'addfav.php', type: 'POST', data: {'id':jQuery(this).closest(div).attr(id),is_ajax:
So I have a list with buttons like: <ul> <li><FORM><INPUT type=button value=some page! onClick=window.open('http://www.pageresource.com/jscript/jwinopen.htm','jwinopen','width=400,height=200,left=0,top=100,screenX=0,screenY=100')></FORM></li>
Basically, I like the way that <input type=submit> is styled, with the clickable button
I have an html button that is being rendered as HTML like such: <input
I would like to have a button in my window such that if I
I have button which post values of form to url but during post i
I would like to have a URL such as www.google.com/ and a user input
Is it possible to have two forms with two submit buttons such that when
If a form is submitted but not by any specific button, such as by
I have iframe with with form elements such as input, select textarea etc. I

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.