Code:
<script type = "text/javascript">
function Proof(obj) {
var el = document.getElementById('proof_type');
el.style.display = (obj.value !="no")? "block" : "none" ;
}
</script>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data">
<input name="proof" id="rad0" type="radio" tabindex="1" value="yes" onclick="Proof(this);" /> Yes
<input name="proof" id="rad1" type="radio" tabindex="2" value="no" checked='true' onclick="Proof(this);" /> No
<div id="proof_type" style="display:none;">Proof Type</div>
</form>
</body>
</html>
Code:
<script type = "text/javascript">
function Proof() {
var el = document.getElementById('proof_type');
var r, i = 0;
while( r = document.getElementsByName('proof')[i++]){
if(r.checked) { el.style.display = (r.value =="yes")? "block" : "none" ; }
}
}
</script>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data">
<input name="proof" id="rad0" type="radio" tabindex="1" value="yes" onclick="Proof();" /> Yes
<input name="proof" id="rad1" type="radio" tabindex="2" value="no" checked='true' onclick="Proof();" /> No
<div id="proof_type" style="display:none;">Proof Type</div>
</form>
</body>
</html>
Bookmarks