Hello all,
I use the following javascript function in a html document to set the
level of one of eight available radiobuttons. The line that's
commented out works fine under IE, but I need to rewrite it so that
it's W3C compliant. Reading through earlier messages I concluded I
should go with getElementById but this doesn't work. What am I doing
wrong?
Your help is much appreciated.
Sofie
function SetRadioLevel(i Level)
{
document.getEle mentById('radio button')[8-iLevel].checked = true;
// document.all.ra diobutton[8-iLevel].checked = true;
}
which refers to:
<input type="radio" name="radiobutt on"
value="radiobut ton" onClick="JavaSc ript:SetZoomLev el(8)">
<input type="radio" name="radiobutt on"
value="radiobut ton" onClick="JavaSc ript:SetZoomLev el(7)">
<input type="radio" name="radiobutt on"
value="radiobut ton" onClick="JavaSc ript:SetZoomLev el(6)">
<input type="radio" name="radiobutt on"
value="radiobut ton" onClick="JavaSc ript:SetZoomLev el(5)">
<input type="radio" name="radiobutt on"
value="radiobut ton" onClick="JavaSc ript:SetZoomLev el(4)">
<input type="radio" name="radiobutt on"
value="radiobut ton" onClick="JavaSc ript:SetZoomLev el(3)">
<input type="radio" name="radiobutt on"
value="radiobut ton" onClick="JavaSc ript:SetZoomLev el(2)">
<input type="radio" name="radiobutt on"
value="radiobut ton" onClick="JavaSc ript:SetZoomLev el(1)">