Hi, i'm experiencing a problem with JSP Buttons. The scenario is as follows.
My "Submit" button is linked directly to the DB and whenever that button is clicked, an entry is recorded. Each entry is meant to be unique. However, during testing, i realized that if you double click on the button, 2 similar entries will be added into the database. The only difference would be the time of entry, which would vary by about 1 second or so.
My question is, is there a way to control this problem?
The codes are as follows
INPUT TYPE=submit VALUE='Yes' style="width:80" name=cmdYes INPUT TYPE=button VALUE='No' style="width:80" name=cmdNo Hopefully someone can help me in this situation
Check to see if the record exists before adding the information to the database.
Joined: Aug 15, 2004
Actually, if dont want to request the server for this kind of thing. I really dont want the double click to work then what I can do?
And ofcourse never rely on client side only. we should do our every type of validations on server-side. And I think if we have our table well defined with constraints like, PK, UK; as I said. then all we have to handle is the thrown exception.