eshera
03-10-2004, 10:03 PM
Please help...
My page loads with a radio button already selected, no problem here, but it is one of 3 buttons. I need to get the value of the one checked 'onload' and show/hide one of three layers.
My short code:
function radioCheck(){
if (document.forms[0].rd[1].checked == true)
{
document.getElementById[table2].visibility = "show";
document.getElementById[table1].visibility = "hide";
document.getElementById[table3].visibility = "hide";
}
}
// -->
</script>
</head>
<body onLoad="radioCheck()">
<form name="radioform">
<input type="radio" name="rd" value="one">one
<input type="radio" name="rd" value="two" checked>two
<input type="radio" name="rd" value="three"> three
</form>
<div id="table1">table one</div>
<div id="table2">table two</div>
<div id="table2">table three</div>
Thank you so much...I've been at this forever!
eshera
My page loads with a radio button already selected, no problem here, but it is one of 3 buttons. I need to get the value of the one checked 'onload' and show/hide one of three layers.
My short code:
function radioCheck(){
if (document.forms[0].rd[1].checked == true)
{
document.getElementById[table2].visibility = "show";
document.getElementById[table1].visibility = "hide";
document.getElementById[table3].visibility = "hide";
}
}
// -->
</script>
</head>
<body onLoad="radioCheck()">
<form name="radioform">
<input type="radio" name="rd" value="one">one
<input type="radio" name="rd" value="two" checked>two
<input type="radio" name="rd" value="three"> three
</form>
<div id="table1">table one</div>
<div id="table2">table two</div>
<div id="table2">table three</div>
Thank you so much...I've been at this forever!
eshera