|
Couple of things to remember...
Never use just a number for an ID, (start with a letter or _).
ID's are unique don't let anyone make more thant one element with the same ID.
If you need to disable an unknown amount of checkboxs put them all inside <span id="myCheckboxs"> ... </span> then to disable them all do...[code:1:7391e0e047]
var chbxs = document.getElementById("myCheckboxs").getElements ByTagName("INPUT");
// asuming the only input fields here are the correct type loop throught them all and disable each one...
for (var i in chbxs) {
chbxs[i].disabled = true;
}
// or if there are different INPUT tags within the <span> you need to add a check for the type="checkbox"...
for (var i in chbxs) {
if (chbxs[i].type == "checkbox") chbxs[i].disabled = true;
}[/code:1:7391e0e047]
|