This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Selection of check boxes" Watch "Selection of check boxes" New topic
Author

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?


http://www.goodercode.com
SCJP 1.4
meera rao
Ranch Hand

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

Joined: Feb 05, 2003
Posts: 4727

Tutorial


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
Greenhorn

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.
 
Consider Paul's rocket mass heater.
 
subject: Selection of check boxes
 
Similar Threads
Selecting all checked checkboxes with jquery
Extracting Database to put information in to creation of form
Select All and Clear All implementation in JSF
Problem in request.getParameterValues()
How to use check boxes with same name