Re: Form with 2 submit buttons
| From: | Jason Brooke | Date: | Sun, 03 Sep 2000 06:20:02 +0000 |
| Subject: | Re: Form with 2 submit buttons | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14965@lists.php.net to get a copy of this message | ||
Use two different 'name' values in each submit
<input type="submit" name="submit1" value="Button One">
<input type="submit" name="submit2" value="Button Two">
Then check which for $submit1 or $submit2.
Just bear in mind that depending on the form, and the browser used, it's
possible to submit a form by hitting 'enter' on the keyboard. In this
situation, the submit field won't be passed so you probably won't be able to
know what action was desired. However, this may not be possible if there are
two submit fields present though - I'm not sure. It won't take much for you
to confirm this with a quick test though.
jason
> Anyone know a good way to have a form submit with one of two different
> submit buttons?
>
> I have a form and want all of the variables of the form passed to one of
two
> different functions depending on which action the user chooses.
>
> I'm using PHP 4 and have a session available if that helps but because
it's
> after the server's processed the information I can't think of how that
will
> really help.
>
> Any ideas?
>
> Thanks.
>
> P.S. Please respond directly to bhorton@pneumasoft.com as well. Thanks.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>