RE: [PHP] internet explorer and form submission

From: Date: Thu, 13 Sep 2001 14:54:13 +0000
Subject: RE: [PHP] internet explorer and form submission
Groups: php.general 
Request: Send a blank email to php-general+get-67224@lists.php.net to get a copy of this message
> so if a particular form button is clicked a different process > will occcur. > > well what happens if i press return to enter my form submission? > nothing is set! > > so the processing file does nothing This has been pointed out from time to time on this list. It is a fact: if the user submits a form with the return key, a submit button value may, or may not, get posted. So don't rely on the submit button. 3 possibilities: 1. If one of the buttons can be considered the "default" action, then write your logic as: if(non-default button) do non-default stuff else do default stuff If no button value gets passed, the default stuff gets done. 2. Again, if one button is "default", put a HIDDEN field with the same name and value as the default submit button just *before* the non-default submit button. The HIDDEN will always get posted, but will get overwritten if the user clicks the non-default button. 3. Write your logic as: if(non-default button) do non-default stuff elseif(default button) do default stuff else meta refresh redirect back to original page In the redirect, put a message asking the user to click a button, with a pause of 5 seconds or so. Kirk

« previous php.general (#67224) next »