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

collect values from a checkbox

Zubi Pen

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.

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

Joined: Jan 10, 2002
Posts: 60782

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

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

[ September 29, 2008: Message edited by: Zubi Pen ]
I agree. Here's the link: http://aspose.com/file-tools
subject: collect values from a checkbox
Similar Threads
Can't pass changed beans values from one JSP page to another
How to set data from the DataBase into jsp:useBean tag?
<jsp:getProperty> returns nothing
Problems with checkbox