Multiple submit buttons problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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
Can i do it in JSP page?

Please tell me.

Re: Multiple submit buttons problem wrote:
Quoted text here. Click to load it

By having multiple input elements of type submit.

Quoted text here. Click to load it

Check the value of whatever name you gave the buttons.

Quoted text here. Click to load it


Re: Multiple submit buttons problem

Quoted text here. Click to load it

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")

Site Timeline