Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
Preventing multiple Submit button clicks
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Gary King
12y
3.6k
1
Reply
I have a rather large web form with btnSubmit event code that can take several seconds to complete.
The problem is that users are clicking the submit button multiple times which causes multiple records to be added to the database.
I found a JS based solution at
http://www.codeproject.com/KB/ajax/disable_btn_on_click.aspx
which initially seemed to work well.
My form has a number of panels that are initially hidden (it is whilst they are hidden that the above solution works).
However, at least one of the panels must be visible (panels become visible when user clicks Checkboxes - one per panel). When one or more of the panels become visible, the solution does not work (that is to say that the submit button remains enabled).
I'm not sure why this is, but suspect it may have something to do with the submit button's reference changing when panels become visible (I may be totally wrong!)
Can anyone suggest how to get the solution to work, or alternative solutions to prevent multiple submits?
Thanks
Gary
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Labels and Textbox in Accordian Control on aspx Form
error in TagPrefix while registering Ajax on Login.aspx form