Hide a form text box on checkbox click.

[Total: 0    Average: 0/5]

This shows how to hide and show a form text box on a checkbox click.

Body Code:

<script>var isIE  = document.all?true:false;var isNS4 = document.layers?true:false;var isNS6 = document.getElementById?!isIE:false;var _checked=false;function boxClicked() {_checked = !_checked;if (_checked) {if (isIE)  document.all.div1.style.visibility="visible";if (isNS6) document.getElementById("div1").style.visibility="visible";} else {if (isIE)  document.all.div1.style.visibility="hidden";if (isNS6) document.getElementById("div1").style.visibility="hidden";}}var _o  = '<a href="javascript:boxClicked()">click to toggle</a><span id=div1 name=div1 style="position:absolute;top:100;left:100;visibility:hidden;">SOME DATA</span>';document.write(_o);</script><HR>This is things after the code.

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *