By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,482 Members | 3,157 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,482 IT Pros & Developers. It's quick & easy.

Multiple submit buttons problem

P: n/a
hello,
How do i declare multiple submit buttons on a form?
and how do i come to know on the next page which button has been
clicked?
Can i do it in JSP page?

Please tell me.

Aug 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ru******@gmail.com wrote:
How do i declare multiple submit buttons on a form?
By having multiple input elements of type submit.
and how do i come to know on the next page which button has been
clicked?
Check the value of whatever name you gave the buttons.
Can i do it in JSP page?
yes

Aug 18 '06 #2

P: n/a
David Dorward <do*****@gmail.comscripsit:
>and how do i come to know on the next page which button has been
clicked?

Check the value of whatever name you gave the buttons.
Actually, when you use normal submit buttons, <input type="submit" ...>, you
can use _either_ different name="..." attributes _or_ different value="..."
attributes, or both, since it's the name=value string that gets sent.

However, there's a tricky problem if there is at least one text input field
in the form, as there is in most forms. If the user hits Enter in such a
field, browsers typically submit the form immediately. There are no rules
for what should happen then; browsers may act as if no submit button had
been used, or as if the first submit button had been clicked, and maybe in
some other way too.

There's no good solution to this, except the use of just one submit button.
In that case, you would have e.g. radio buttons for making the choice that
would otherwise be made by selecting which submit button is used.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Aug 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.