Click to See Complete Forum and Search --> : document.getElementById(divName);


argoman
07-05-2005, 09:02 AM
How do I get the divName of parentnode from the form? The div name is "radioButtons" and inside the div are 2 radio buttons Yes/No both with an onClick="radio(this)"


function radio(obj) {

var parentnode = document.getElementById(divName);
var allMyChildren = parentnode.childNodes.getElementsByName("INPUT");

alert(allMyChildren.length);
for (var i=0;i < allMyChildren.length;i++) {
var radiolist = allMyChildren[i];
if (radiolist.type == "radio") {
radiolist.checked=true;
}
}

}

vwphillips
07-05-2005, 01:44 PM
var parentnode = obj.parentNode;