Re: Form Submit Button Question



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
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.
The recommended Javascript worked great.

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
.



Relevant Pages

  • Re: Form Submit Button Question
    ... Javascript Onclick event on each button to set form.action. ... When I hit ENTER on the computer keyboard, ... Firefox choose the "Change Password" button (I assume because it is the ... The script uses the $_POSTvalue to determine what to do as ...
    (comp.lang.php)
  • Re: for each file loop question on reading variables
    ... Is the thing that you want to do based on filename a control lfow thing or is it a data thing. ... In the Control Flow you may want to use the Script task. ... If what you want to do is simply make a FF Connection Manager point to this new file then you need to look at property expressions. ... Highlight the Conection Manager, hit F4, ind the Expressions item and hit the ellipses. ...
    (microsoft.public.sqlserver.dts)
  • Re: process a BIG string
    ... I won't hit the memory limit because i only read about 10 to 64Kb at a ... in buffers of about 8192bytes and process each buffer, ... the problem is that with large filesi get a script error(Fatal ... You might also hit the roof of your memory usage if you handle and process ...
    (comp.lang.php)
  • Re: Password complexity..domain policy
    ... The script that does that forces user to change password on next login is ... Schedule this script as a task to run after few days (under account that has ... >>> so when would this policy apply to existing users?? ...
    (microsoft.public.win2000.active_directory)
  • Re: import magic
    ... Then I run this Funduc script to tidy it up. ... Before Hit=< ... Display Replace String=0 ... Min Date Filter= ...
    (comp.lang.java.programmer)