RE: [PHP] Example needed

From: Date: Tue, 01 Aug 2000 21:43:15 +0000
Subject: RE: [PHP] Example needed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-9568@lists.php.net to get a copy of this message
> At 12:33 PM -0700 8/1/00, Chris Kovalcik wrote: > >Hi, > >Does someone have a quick example on how to prevent multiple submits > >from a form? > >Say, a 30 sec delay until the same person can submit the > same form again? > > > >Thanks, > >Chris > > > This might not work in your case, but what I have often done is this: <snip> Seems awfully complicated. Could alternatively be done using a smidgeon of JavaScript. <SCRIPT TYPE="text/javscript"> <!-- var somevar = 0; function disablebutton(){ if(somevar == 0){ somevar = 1; return true; }else{ return false; } } // --> </SCRIPT> And add this attribute to your submit button: ONCLICK="return disablebutton()" Untested, maybe errors. -- Richard Heyes http://www.heyes-computing.net/scripts/ Plain text email only please!

« previous php.general (#9568) next »