wood burning stoves 2.0*
The moose likes JSP and the fly likes collect values from a checkbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "collect values from a checkbox" Watch "collect values from a checkbox" New topic
Author

collect values from a checkbox

Zubi Pen
Greenhorn

Joined: Oct 24, 2007
Posts: 26
Hey peep,

I am very new to jsp/java and need some help.

I have a form that has four checkbox's that has different values (which is pulled from the database).

When I press the 'Compare' button, the page 'compare.jsp' is displayed.



Please note the form tag is displayed via a loop so in each loop the value of the checkbox is different.

My question is how can I collect the values of the checkbox, loop through them and display it on the page compare.jsp.

Thanks,
[ September 29, 2008: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61458
    
  67

I'm a bit confused. You are trying to gather the values of the input elements on the same page that they're created upon?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Zubi Pen
Greenhorn

Joined: Oct 24, 2007
Posts: 26
The form is on a different page called form.jsp, and I am trying to get the values on the compare page which is compare.jsp.

Could you tell me how can to write a set method in java that takes in an array of strings, so basically I can pass the values of the form in the method.

I can then use a get method and loop through the array and display the values. That what I am thinking

Thanks,
Zub
[ September 29, 2008: Message edited by: Zubi Pen ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: collect values from a checkbox