This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple form elements with same name  RSS feed

 
Sverre Moe
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sverre Moe
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you try to get the values in your servlet ?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!