Re: Re[2]: [PHP] Re: Form Submission
| From: | Justin Patrin | Date: | Tue, 06 Jul 2004 18:55:32 +0000 |
| Subject: | Re: Re[2]: [PHP] Re: Form Submission | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189811@lists.php.net to get a copy of this message | ||
On Tue, 6 Jul 2004 18:15:17 +0200, Torsten Roehr <roehr@zilleon.com> wrote:
> "Richard Davey" <rich@launchcode.co.uk> wrote in message
> news:305260220.20040706164411@launchcode.co.uk...
> > Hello Jason,
> >
> > Tuesday, July 6, 2004, 2:37:08 PM, you wrote:
> >
> > JW> It might not be a good idea to rely on the "submit" button to be set.
> Some
> > JW> browsers do not set/send it if you didn't explicitly click on the
> "submit"
> > JW> button. I would use:
> >
> > Absolutely. If you hit ENTER to submit a form (rather than click the
> > button) you often don't get sent the button value.
> >
> > Best regards,
> >
> > Richard Davey
>
> I never had this problem. Usually the first submit button will come into
> effect when hitting enter. And my question remains:
>
> How do you check which button was pressed (read: which action should be
> performed) when not relying on this?
>
The button is generally *not* sent by the browser if you hit enter
instead of submit. This *will* happen, so you have to deal with it.
If you want to knwo what button was pressed, you have to have
different button names or values and check them. A button is just
another form element that is submitted.
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--