| Author |
Multiple form elements with same name
|
Sverre Moe
Ranch Hand
Joined: Jul 10, 2007
Posts: 109
|
|
My page consists of several different forms. 4 of these forms has an element in common (customerNumber). All forms are rendered in HTML, but not all are shown(all but one is hidden). So when I submit the form that is shown does not retain the value within its customerNumber. When I tried to rename its name it worked, but I would like to reuse the name, instead of having multiple names for the same purpose value element.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56153
|
|
By "name" do you mean name or id? There is no problem having multiple elements with the same name, even within the same form. id is a different matter.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Sverre Moe
Ranch Hand
Joined: Jul 10, 2007
Posts: 109
|
|
Originally posted by Bear Bibeault: By "name" do you mean name or id? There is no problem having multiple elements with the same name, even within the same form. id is a different matter.
When I used the same name on similar form elements, then on submit those values did not make it to the Servlet. Only when I renamed them with unique name it worked.
|
 |
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
|
|
|
How do you try to get the values in your servlet ?
|
SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
|
 |
 |
|
|
subject: Multiple form elements with same name
|
|
|