You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Glanville, Jay" <Ja...@NaturalConvergence.com> on 2004/03/22 20:50:49 UTC
[OT] multiple submit buttons on a single page
Hello all.
A slightly of-topic question for the group ...
The situation: a form with two submit buttons, and the user doesn't use
either of them, but instead submits the form by pressing enter/return in
one of the text fields.
Question: how does the form get submitted? Is it by:
- the action attribute of the form (<form name="XXY"
action="Action.do">)
- the first submit button
- the second submit button
- both submit buttons
My tests have shown one answer, but I'd like some confirmation (just
because test X says something doesn't mean my test is accurate! ;-) ).
Thanks
JDG
--
Jay Glanville
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: [OT] multiple submit buttons on a single page
Posted by Colin Kilburn <co...@accesstec.ca>.
Hi Jay,
In my experience (although I haven't paid attention to it lately),
neither button (e.g. submit=<button caption>) is submitted. This may
also depend on the browser.
HTH,
Colin
Glanville, Jay wrote:
>Hello all.
>
>A slightly of-topic question for the group ...
>
>The situation: a form with two submit buttons, and the user doesn't use
>either of them, but instead submits the form by pressing enter/return in
>one of the text fields.
>
>Question: how does the form get submitted? Is it by:
>- the action attribute of the form (<form name="XXY"
>action="Action.do">)
>- the first submit button
>- the second submit button
>- both submit buttons
>
>My tests have shown one answer, but I'd like some confirmation (just
>because test X says something doesn't mean my test is accurate! ;-) ).
>
>Thanks
>
>JDG
>
>
>--
>Jay Glanville
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: [OT] multiple submit buttons on a single page
Posted by Brian Buchanan <br...@interfast.ca>.
What I've learned is that here is no standard or recommendation defining
what should happen when the user hits enter on a text box, so browsers are
allowed to do whatever they want.
OTOH, this is what I've observed:
When the user hit's enter while context is in a text box:
1. Internet Explorer 6 with single text box does not submit any submit
button, it just submits the text box value.
2. IE 6 with multiple text boxes submits the first submit button on the
form.
3. Opera 7 with any text boxes submits the first submit button AFTER the
text box.
This lead my design to the least-destructive submit button first, and placed
after all text boxes. Where there's only one text box in the form, I assume
a default action on the server side.
I did not try any other browsers (i.e. netscape, safari, etc.), any other
version of the above browsers, or any other platforms (tested only on W2K
Pro).
This page
http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.html
seems to have a good summary and explains item 1 above with a suggestion
found in the HTML 2.0 spec:
http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2
This google link suggests that alot of people have been talking about this
issue:
http://www.google.com/search?q=form+submit+enter
._. Brian
-----Original Message-----
From: Glanville, Jay [mailto:Jay.Glanville@NaturalConvergence.com]
Sent: Monday, March 22, 2004 2:51 PM
To: Struts User List
Subject: [OT] multiple submit buttons on a single page
Hello all.
A slightly of-topic question for the group ...
The situation: a form with two submit buttons, and the user doesn't use
either of them, but instead submits the form by pressing enter/return in
one of the text fields.
Question: how does the form get submitted? Is it by:
- the action attribute of the form (<form name="XXY"
action="Action.do">)
- the first submit button
- the second submit button
- both submit buttons
My tests have shown one answer, but I'd like some confirmation (just
because test X says something doesn't mean my test is accurate! ;-) ).
Thanks
JDG
--
Jay Glanville
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: [OT] multiple submit buttons on a single page
Posted by Benz Lim <be...@bizwave.net>.
-<form action="Action.do">----
| |
| |
| [ ] text field |
| |
| [submit1][submit2] |
-</form>-----------------------
By default the first submit button should be activated for the submission.
If you press enter/return key a key event(ENTER) is send which is
equivalent to the submit button. Since now there are two button
an array is form if you were to name them the same by
browser definition the first button is send.( if it is an array the first
will be send).
As with wendy view,
A form theorically should have only 1 submit button.
Hope this help.
Best Regards,
Benz Lim
-----Original Message-----
From: Glanville, Jay [mailto:Jay.Glanville@NaturalConvergence.com]
Sent: Tuesday, March 23, 2004 3:51 AM
To: Struts User List
Subject: [OT] multiple submit buttons on a single page
Hello all.
A slightly of-topic question for the group ...
The situation: a form with two submit buttons, and the user doesn't use
either of them, but instead submits the form by pressing enter/return in
one of the text fields.
Question: how does the form get submitted? Is it by:
- the action attribute of the form (<form name="XXY"
action="Action.do">)
- the first submit button
- the second submit button
- both submit buttons
My tests have shown one answer, but I'd like some confirmation (just
because test X says something doesn't mean my test is accurate! ;-) ).
Thanks
JDG
--
Jay Glanville
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org