I wrote a simple code that should display a hidden element if one of the check boxes is checked and hide it back when all checkboxes are un-checked. I keep getting errors and have no idea why… Here’s my code:
[code=php]
<html>
<head>
<script language=”JavaScript”>
<!–
function unCheckRadio(oRadio) {
var or = document.getElementsByName(oRadio);
for (var i = 0; i < or.length; i++) {
or[i].checked = false;
}
}
function toggleOther() {
if(document.getElementByID(“tlntSpot_other”).checked) {
document.getElementById(“otherTlnt”).style.display = “block”;
} else {
document.getElementById(“otherTlnt”).style.display = “none”;
}
}
//–>
</script>
</head>
<body onLoad=”toggleOther();”>
<form>
<table>
<tr>
<td><input type=”radio” name=”tlntSpot_other” id=”tlntSpot_other”value=”10″ onClick=”toggleOther();”>10</td>
<td><input type=”radio” name=”tlntSpot_other” id=”tlntSpot_other”value=”15″ onClick=”toggleOther();”>15</td>
<td><input type=”radio” name=”tlntSpot_other” id=”tlntSpot_other”value=”25″ onClick=”toggleOther();”>25</td>
<td><a href=”javascript:unCheckRadio(‘tlntSpot_other’); toggleOther();”>un-check</a></td>
</tr>
<tr id=”otherTlnt”>
<td colspan=4>
Hidden content here…
</td>
</tr>
</table>
</form>
</body>
</html>