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

  • Home
  • SEARCH
  • 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 8213465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:07:38+00:00 2026-06-07T11:07:38+00:00

To prevent accidental submits and make sure the user doublechecks all the information he

  • 0

To prevent accidental submits and make sure the user doublechecks all the information he entered, I delayed the submit of a form by having popup another button that asks whether he really wants to submit…

Unfortunately when the user clicks ‘no’ and submits the form later with the ‘yes’ button, it will submit twice. It works the first time when the user hasn’t clicked ‘no’ before…

I prepared a little jsfiddle here, and thats my code:

$('#form').on('click','#submitbutton',function(e){
        e.preventDefault()
        $('#formchecker').show()
        $('#doit').click(function(e2){
            e2.preventDefault()
            alert('I will submit as you say')                
        })
        $('#dont').click(function(e2){
            e2.preventDefault()
            $('#formchecker').hide()
        })
})

You can see when clicking ‘nah’ before submitting with ‘yes’, there will be more than one alert-box. Someone got a hint why it behaves that way ?

  • 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-07T11:07:41+00:00Added an answer on June 7, 2026 at 11:07 am

    Each time the submit button is clicked you are adding click events to the yes and no buttons, but you are never clearing them, so if you were to click submit then no 5 times, finally clicking yes would fire 5 times.

    You should unbind the click events before binding new ones, or don’t bind the click events within the click event of the submit button.

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

Sidebar

Related Questions

I want to have a confirmation from the user before they submit a form.
I'm trying to prevent certain keys from being entered into an input box, but
I want to prevent the user's concurrent login based on the admin settings. If
Possible Duplicate: Prevent any form of page refresh using jQuery/Javascript how can i prevent
I want to prevent accidental activation of tooltips on hover by using .delay and
I'm developing a peculiar application which need to prevent the user can go out
I'm looking for the best way to prevent accidental deletion by IT - perhaps
To prevent SQL injection, is it necessary to use mysql_real_escape_string() , when magic_quotes_gpc is
I'm trying to prevent an associated record from being deleted if it has associated
I want to prevent my activity from restarting when I change the orientation from

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.