Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

storing check boxes values into diffrent columns

 
viji reddy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I have 3 checkboxes.I want to store selected checkboxes values into diffrent coumns that is one check box value into one column.and making unselected checkbox values in data base columns as null.iam using servlets/jsp.how can i insert ..

kindly help me.

thanks
 
Ajith Prasad
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
document.formname.checkboxname.checked gives the name of the checkboxes you have selected and get those values correspondingly.get those values in servlet using request.getParameter("") and then do the database operations
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In case you have multiple checkboxes/parameters under on name, which is a norm, you can use request.getParameterValues(). This way you will only get checked boxes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic