Re: Self-Process php forms or not?
| From: | Manuel Lemos | Date: | Fri, 02 Oct 2009 21:55:46 +0000 |
| Subject: | Re: Self-Process php forms or not? | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298495@lists.php.net to get a copy of this message | ||
Hello,
on 10/02/2009 05:23 AM kranthi said the following:
>>> That only works if the user clicks on that submit button. If the user
>>> hits the enter key in a text input, the form is submitted but the submit
>>> input variable is not set. That is why an hidden input is a safer solution.
>
> i doubt that, because i use the above mentioned method in nearly all
> of my projects, and all of them are working fine.
>
> P.S: i prefer keyboard to mouse as a input device
Sorry, what I meant is that if you have multiple submit buttons in your
form, say "Preview", "Save" and "Cancel", if you hit enter in a text
input it will not set the variables for all buttons. At most only one
button variable is set, which usually is the first button in the HTML,
but you have no way to change which will be set.
If you use an hidden field is easier to determine whether the form was
submitted or not, as you do not have to check variables for all buttons.
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/