It's free and you have access to premium codes!
Welcome back! Please login to your account.
Don't worry, we'll send you a message to help you to recover your acount.
Please check your email for instructions to activate your account.
Written by 6 March 2013
Textbox hiding while dropdown selection
<!-- this script is provided by https://www.javascriptfreecode.com coded by: Kerixa Inc. -->
<html>
<head>
<script type="text/javascript">
function changetextbox()
{
if (document.getElementById("mfi_4_a_i").value =="No") {
document.getElementById("sdd").style.display='none';
} else if (document.getElementById("mfi_4_a_i").value =="Yes") {
document.getElementById("sdd").style.background='pink';
}
else{
document.getElementById("sdd").style.display='block';
}
}
</script>
</head>
<body>
<select id="mfi_4_a_i" name="mfi_4_a_i" onChange="changetextbox();">
<option>Yes</option>
<option>No</option>
<option>No, but planning in future</option>
</select>
<textarea name="mfi_4_a_ii" id="sdd" style="border:1px solid black; width:200px;height;30px;" /></textarea>
</body>
</html><a target='_blank' href='https://www.javascriptfreecode.com' style='font-size: 8pt; text-decoration: none'>JavaScript Best Codes</a>
Comments
Here you can leave us commments. Let us know what you think about this code tutorial!