L
laszlo
Please help me.
I have a radio box set, name is in rname variable, want to change the
checked status to the indexed box, index is in ii variable.
I tried
d = getElementById(rname);
d.value = ii; //this works fine if rname is text, textarea
if (d.type == radio) d[ii].checked = true;
I get for the above line an undefined is null or not an object error
for the d[ii].checked = true; statement.
If I set:
d.checked = true;
i.e. without index it sets the very first box to checked
Question: how to set checked the last (or arbitrary in sequence)
radiobox?
I have a radio box set, name is in rname variable, want to change the
checked status to the indexed box, index is in ii variable.
I tried
d = getElementById(rname);
d.value = ii; //this works fine if rname is text, textarea
if (d.type == radio) d[ii].checked = true;
I get for the above line an undefined is null or not an object error
for the d[ii].checked = true; statement.
If I set:
d.checked = true;
i.e. without index it sets the very first box to checked
Question: how to set checked the last (or arbitrary in sequence)
radiobox?