Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTML question  RSS feed

 
Alok Pota
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have a bunch of checkboxes with the same name
inside a form and I submit the form. What is the request string that is generated by the browser and how do I check it?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alok,
When you have multiple checkboxes in the same form that all have the same name, each box that is checked will generate an individual request parameter with that name when the form is submitted. The values of the parameters will be whatever you specified in the value attribute to the input tag.
To get the multiple values for the request parameters you'll need to use the getParameterValues() method of the request instance passing the common name. This will return an array of Strings for all the values.
hth,
bear
[ March 20, 2002: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!