Re: Form Submit Button Question
- From: Juliette <jrf_no_spam@xxxxxxxxxxxx>
- Date: Fri, 07 Jul 2006 04:03:51 +0200
flamer die.spam@xxxxxxxxxxx wrote:
no that is set in the browser, by default hitting enter is the same as
pressing submit.. HOWEVER.. fyi: when you press submit in the POST data
then $_POST[submit]=submit but if they press enter (only in IE) then
$_POST[submit] is not set..
thats off topic but can cause some confusion if in your scripts you use
if (isset($_POST['submit'])) { process form }
because if they hit enter rather than clicking submit then it wont be
set ect.. (use a hidden form field and check if that is set instead)
Flamer.
David T. Ashley wrote:
"Chuck Anderson" <websiteaddress@xxxxxxxxx> wrote in message
news:xvmdnZvd3Zu1CDHZnZ2dnUVZ_tCdnZ2d@xxxxxxxxxxxxxx
The recommended Javascript worked great.javascript will do it.To clarify that a bit more - do not put an action in the form tag. Use a
Javascript Onclick event on each button to set form.action.
Just one question ... my form buttons are "Change Password" and "Cancel", in
that order. When I hit ENTER on the computer keyboard, both IE and Mozilla
Firefox choose the "Change Password" button (I assume because it is the
first button in the form).
Is that the reason ENTER chooses one button (because it is first on the
form)?
Can this order or selection be modified?
Thanks.
Hmm.. don't know which version of IE you are using, but your comment made me test a private script which I until now had only used in FF.
The script uses the $_POST['submit'] value to determine what to do as there are three different forms on the page.
No matter which form I changed and then submitted with the ENTER button, the resulting page showed that the requested action had been properly taken, i.e. the value of the Submit button has been passed on properly.
Tested with IE6.
Grz, Juliette
.
- Follow-Ups:
- Re: Form Submit Button Question
- From: flamer die.spam@xxxxxxxxxxx
- Re: Form Submit Button Question
- References:
- Form Submit Button Question
- From: David T. Ashley
- Re: Form Submit Button Question
- From: flamer
- Re: Form Submit Button Question
- From: Chuck Anderson
- Re: Form Submit Button Question
- From: David T. Ashley
- Re: Form Submit Button Question
- From: flamer die.spam@xxxxxxxxxxx
- Form Submit Button Question
- Prev by Date: Re: method="POST" changes '.' to '_'
- Next by Date: Re: Form Submit Button Question
- Previous by thread: Re: Form Submit Button Question
- Next by thread: Re: Form Submit Button Question
- Index(es):
Relevant Pages
|