permaculture playing cards
The moose likes Struts and the fly likes Selection of check boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Selection of check boxes" Watch "Selection of check boxes" New topic

Selection of check boxes

meera rao
Ranch Hand

Joined: Jun 30, 2005
Posts: 67
I have seperate checkboxes in a jsp page. after the user selects a couple of chec boxes, I would like to pass the information to the database .

How would I check which checkboxes where selected or not?
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
Are you using struts?
SCJP 1.4
meera rao
Ranch Hand

Joined: Jun 30, 2005
Posts: 67
yes I am using struts
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727


A good workman is known by his tools.
meera rao
Ranch Hand

Joined: Jun 30, 2005
Posts: 67
I checked out the tutorial ,, but somehow i am not able to implement it. Can somebody help me out please.

I am populating a table from an arraylist and one of the columns is plain checkboxes( which do not have any values in the d/b).

I am not sure how to check if the user selected the checkbox. ( user can check more than one checkbox).
latha yeduguri

Joined: Jun 24, 2005
Posts: 17
This can be done through Javascript. if your check box is checked, make the value As 'Y' , If it is not checked make the value of the check box as 'N', when you submit the form. The same values will get updated to the database. while you are retrieving from the database you have to check for 'Y' to check the check box.
I agree. Here's the link:
subject: Selection of check boxes
It's not a secret anymore!