Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

multi check boxes in jsp  RSS feed

 
Bart Wilson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help getting started. I'm new at this.
I have a group of check boxes a user can select one or more protective devices listed (burglar alarm, deadbolt locks, etc.)
They all have the same name but different values.
The function to get their value is:
protectiveDevice.isDevice(int)
this returns a boolean true
How do I script to determine which check boxes where checked?
I have something so far but not sure if correct
value = "<%=protectiveDevice.isDevice(1) == true ? protectiveDevice.isDevice : false%>"
value = "<%=protectiveDevice.isDevice(2) == true ?
protectiveDevice.isDevice : false%>"
Thanks
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just conver this to script. Since only checked checkboxes will be sent to the server, this should work.
String [] checkedBoxes = request.getParameterValues("nameOfYourCheckBox");
for(int i = 0; i< checkedBoxes.length; i++)
do whatever....



------------------
Bosun
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!