• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

checkbox property

 
meghana maganti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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) {
........
}

}
 
Marc Larochelle
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic