• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

checkbox property

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a group of checkboxes in my jsp page and i am trying to give
this part of code in javascript and using mozilla firefox browser but it complaines as the property length is "undefined"

for(var i=o; i<document.forms[0].ch_pk.length; i++) {

if(document.forms[0].ch_pk[i].checked == true) {
........
}

}
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ch_pk is a checkbox?
What "length" sould return?
I don't think that you can "group" checkboxes, you can only do that with radio buttons no?
 
meghana maganti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Marc,

I am trying to display the checkboxes in a column when a list is iterated and checkbox lenght should return the number of checkboxes and from that i am trying to retrieve the ones that are checked in a JavaScript
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic