RE: [PHP] Example needed
| From: | Steve Edberg | Date: | Tue, 01 Aug 2000 22:40:40 +0000 |
| Subject: | RE: [PHP] Example needed | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-9590@lists.php.net to get a copy of this message | ||
At 10:43 PM +0100 8/1/00, Richard Heyes wrote:
At 12:33 PM -0700 8/1/00, Chris Kovalcik wrote:True - but the database approach will work regardless of browser javascript support (or, for that matter, whether the browser supports cookies, or doesn't handle no-cache headers correctly, if you're trying to use either of those approaches). -steve +--- "They've got a cherry pie there, that'll kill ya" ------------------+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 thesame form again?Thanks, ChrisThis 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. --
| Steve Edberg University of California, Davis | | sbedberg@ucdavis.edu Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ |+-------------------------------------- FBI Special Agent Dale Cooper ---+