Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling a button on a form

Status
Not open for further replies.

AnnIsabelle

Programmer
Apr 10, 2001
9
BE
Hi,
I'm making a form with a button on it. The button has an onClick-event that calls a function. After the first time the user has clicked the button,I want to disable it. This way the user can only click once. I need this because the function I call checks the answer given by the user and, if correct, increases a score. Now the user can click an indefinite number of times and augment the score.

Thanks,
AnnIsabelle
 
I have seen it done using a toggle variable. After it is clicked once it changed the onclick event to onblur whick keeps them from clicking it again.

You can get the actual code from JavaScript pros over at that forum.

» » » » » »
Mike Barone
FREE and Pro CGI/Perl Scripts

FREE Scripts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top