Forum Moderators: not2easy
<script>
function SetState(obj_checkbox, obj_text)
{ if(obj_checkbox.checked)
{ NwLink.style.display = 'block';
return true;
}
else
{ NwLink.style.display = 'none';
return true;
}
}
</script>
<form name="form">
<table width="600">
<tr>
<td>
News:<br>
<input type="checkbox" onclick="SetState(this, document.form.NewsIntroText)">
</td>
</tr>
<tr id="NwLink" style="display: none;">
<td>
Intro text:<br>
<input type="Text" name="NewsIntroText">
</td>
</tr>
<tr>
<td>
and here is some more text
</td>
</tr>
</table>
</form>
You are trying to hide a table row (<tr>), which is problematic as it is an integral element within the table.
Why not put a <div> in the <td> that holds the element you wish to hide, and use:
document.getElementById('layerName').style.visibility='hidden/visible'
To toggle the showing and hiding of the layer and element.