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

double clickers prob...

Status
Not open for further replies.

thompom

Technical User
Dec 4, 2006
395
GB
Hi,

have researched the double click submit prob and it seems that the solution is to put
Code:
this.disabled=true;
in the onclick event of a button

OR put this in the form tag
Code:
onsubmit="this.done.disabled = true;"

have tried both but still can 'double book'

can anyone see why this wont work for me

my submit button
Code:
<input name="done" type="image" id="done" src="images/tbot6_01.gif" width="87" height="50" border="0" onclick="this.disabled=true;this.form.a.value='A';return EW_checkMyForm(this.form);">

OR

my form tag
Code:
<form action="custaddwork.asp" name="custaddwork" id="custaddwork" method="post" onsubmit="this.done.disabled = true;">

 
Your best bet by far is to do any double-submission detection server-side. That way, it will also work for those users who have JavaScript disabled.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
hi dan - thanks for your reply

what is the best way to do server side double click submission?

do you have an example?

am thinking something like timestamping the record, then if the the timestamp is less than 2 secs and the customerid is the same as the last record then dont do it??

surely this takes up a lot of processing power as two more recordsets will have to opened.

any ideas welcome

by the way i have some very enthusiastic clickers!

 
A timestamp could work... although I'd be mor tempted to deliver a GUID into a hidden form field, and then with any submission, check to make sure that GUID hasn't already been submitted.

If it has, you know you're dealing with a duplicate entry.

You could clear the list down at the end of every day so it would never grow too large.

It might be best to ask in the forum for your server-side technology about dup-checking, as there may already be a standard mechanism in place.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top