[thelist] onclick="this.submit.button.is.disabled.and.greyed.out" ?

Tony Light TonyLight at blueyonder.co.uk
Mon Sep 23 12:44:01 CDT 2002


--
[ Picked text/plain from multipart/alternative ]
Dunstan,

As well as any javascript to prevent the button being pressed twice, consider trapping this at the server as well.
After all, not everyone has js on (as I'm sure someone in this forum might have mentioned once a long time ago!).

A simple way to do this would be to generate a unique key to identify each form on your page.  If you involve a really precise current date/time and concatenate that with the form name, that should do it.
You could put this in a hidden field on the form.

When the form is submitted, take this hidden key and write it to a table.  The only field the table needs is a primary key long enough to hold these keys you are generating.
(You can hold more info if it would be useful - but just the one field is all you need).

If the write succeeds - then it is the first time this instance of the form has been submitted.
If it fails because of a duplicate primary key, then the form has already been submitted.
Branch your code accordingly.

HTH
    Tony.
--




More information about the thelist mailing list