Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Selection of check boxes

 
meera rao
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using struts?
 
meera rao
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes I am using struts
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tutorial
 
meera rao
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic