Jump to content
mickeymouse

Prevent Double Entry

Recommended Posts

My page allows the user to type in a number and click Enter or press the Enter Key (submit button). My next page then process that number.

But if the user clicks twice (or presses the Enter Key twice), my next page gets the number twice.

How can I prevent the user from doing this double entry?  e.g. Can I disable the submit button after it's been used?

Tks

 

Share this post


Link to post
Share on other sites

Sorry.  I guess I wasn't clear.

I am using "onsubmit" in Form. My input tag is a "type=submit".  When the user clicks on this 'submit' button more than once (or presses the "Return" key more than once) I end up with multiple entries.  My "onsubmit" goes to a function that checks to see if the input number is valid and if OK the submission is allowed (return true).

So, how do I prevent multiple submissions from taking place.  There should not be another entry until there is a visible server  response to the first submission.

 

Share this post


Link to post
Share on other sites

Disable the element (button) in the submission portion of your code.

Button will not be re-enabled until the page is reloaded after processing of the form.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...