PDA

View Full Version : checkboxes



cassy
06-11-2009, 05:46 PM
Hi there,

I would like to use the follwoing script for select all/ none buttons found in the archive of this forum. my problem is that my query will result in a list of checkboxes requiring me to using a div class for them

only how could I get the below script to work for me then?


function checkAll() {
var container;
if (document.getElementById && (container = document.getElementById('cBoxes')) && container.getElementsByTagName) {
var controls = container.getElementsByTagName('input');
for (var i = 0, n = controls.length; i < n; ++i)
if (controls[i].type == 'checkbox')
boxes[i].checked = true;
}
}

function checkNone() {
var container;
if (document.getElementById && (container = document.getElementById('cBoxes')) && container.getElementsByTagName) {
var controls = container.getElementsByTagName('input');
for (var i = 0, n = controls.length; i < n; ++i)
if (controls[i].type == 'checkbox')
boxes[i].checked = false;
}
}

vwphillips
06-12-2009, 09:04 AM
my problem is that my query will result in a list of checkboxes requiring me to using a div class for them

please explain more fully and or provide sample HTML or link

cassy
06-12-2009, 09:59 AM
thank you but I am using a different script now