RE: [PHP] multiple submit buttons
| From: | Matt McClanahan | Date: | Wed, 20 Dec 2000 06:22:02 +0000 |
| Subject: | RE: [PHP] multiple submit buttons | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31160@lists.php.net to get a copy of this message | ||
On Wed, 20 Dec 2000, Samantha Savvakis wrote:
> Now, this all works fine if I actually move the mouse to the button and
> click on it, or if I tab to the button itself and hit the enter key.
>
> But - this is where the problem is. If I have the cursor in the text field,
> I hit the enter key (which enters on the default button), $HTTP_POST_VARS
> has no recollection of "submit" as a post variable. Hence, $submit has no
> value, hence none of the if/else statement actually works.
>
> I have this problem in IE browsers (since Netscape doesn't have a default
> button). Is there a fix for this? I thought PHP would be able to realise
> that the page has submitted because of the default button and place it into
> HTTP_POST_VARS.
>
> Any ideas?
Sounds like a browser issue. If PHP isn't receiving a value for submit,
it's possible IE isn't sending one. If you use method="get" rather than
post, you can see if a value for submit is being passed. If not, there's
probably very little you can do. Maybe a bit of Javascript on the text
field that sets a submit value, an onChange or something? (Says the person
with no JS experience whatsoever)
Matt