• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

multi check boxes in jsp

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic