double click button

I am having a problem where a client is sometimes double clicking on a button on my web app page and this is causing two entries in my database. I've found a few long winded approaches to solving this, anyone got a simple up to date solution?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
Disable the button via Javascript during the click event, perhaps?
I think every developer faces this issue sometime. As mentioned by @Kaufmed disabling the button is one way. Here's an example.

- In addition, I sometimes add a overlay message informing the user something is being process and block the entire screen.

- I have seen certain websites explicitly informing user to click the button only once.
Johny BravoCommented:
A simple approach might be, check it in your stored procedure
Create procedure addData
@name varchar(50),
@add varchar(50),
@email varchar(50)
If Not exists(select * from yourtable where name != @name and email != @email)
insert into yourtable (----------)


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Monica PSoftware DeveloperCommented:

Check this :

You can make use of  OnClientClick and UseSubmitBehavior properties of the button control. There are other methods, involving code on the server side to add attributes,
Paulmc999Author Commented:
The DB INSERT solution was the neatest to implement and fixed problem immediately. Thanks guys.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.