> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to