| Article: |
PHP Form Handling | |
| Subject: | Form submission with hidden element | |
| Date: | 2004-11-15 21:58:56 | |
| From: | az_pete | |
|
You mentioned: testing for the presence of a hidden element avoids problems that can result from browsers' varying behaviors when a user submits a form by pressing the Enter key instead of clicking a submit button. Could you elaborate on the problems that result when a user presses the enter key versus clicking the submit button? I have generally just tested for the value of the submit button within my scripts instead of having to manage another form element (e.g. if (isset($_POST['submit_button_value'])) {process form} ). Is this not as good a method? Any thoughts would be appreciated. Thanks. |
||
Showing messages 1 through 2 of 2.




Only some browsers act this way. I believe IE 7.0 is one.
Therefore you cannot use the name/value pair for the submit button as a reliable test for the form being submitted. Hidden elements do show up.
I have experienced this problem with PHP5, but not with PHP4. Cannot explain that one.