aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes checkbox property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "checkbox property" Watch "checkbox property" New topic

checkbox property

meghana maganti

Joined: Sep 13, 2005
Posts: 11
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

Joined: Sep 16, 2005
Posts: 14
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

Joined: Sep 13, 2005
Posts: 11
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
I agree. Here's the link:
subject: checkbox property
Similar Threads
How to submit a page on change of Combo using Struts
adding numbers
I need object name from value
show/hide formfields
Java Script problem