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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting the Clicks on Submit Button

Status
Not open for further replies.

greyone

Programmer
Dec 14, 2000
200
CA
Hi
is there a way to count the number of OnClick's on a submit button ? I would like to restrict the clicks a user makes on the submit button. In other words i want to force the user to click on the submit button just once and if they click on it more than once the form should be submitted just once and not 3 or 4 or 5 times.
Please help


 
I don't think that there is -- :-( -- just look at the submit post button on the preview post page on this site... what do you see??? "Click only once" -- and yet you still see double posts from time to time when users get impatient. I believe those are just the breaks.

The way that I restrict the users from doing that is this... and it's not foolproof --

If I anticipate a script taking a while to run after they click the button, then on the page that is processing the script, I make sure that there is some html output on the page before any of the processing starts taking place -- this makes the browser go ahead, flip over and start to render that page, and then does the processing -- and then finishes output when it's done processing

I don't think that's printed in any whitepages anywhere ;-) but it seems to work fairly well for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top