here is an example script using a select list value to toggle a txt field visibility, notice that I call the setTextField() function just before the body tag, this is to trigger the function to show it onload of the page if the selected option is 3, change the selected option to see this in action.
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script type="text/javascript">
function setTextField() {
var theList = document.getElementById("select");
var theText = document.getElementById("textfield");
var theSelectedValue = theList.options[theList.selectedIndex].value;
if(theSelectedValue == "3") {
theText.style.display = "block";
} else {
theText.style.display = "none";
}
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<p>
<select name="select" id="select" onChange="setTextField();">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3" selected="selected">Three</option>
<option value="4">Four</option>
</select>
</p>
<p>
<input type="text" name="textfield" id="textfield" style="display: none;">
</p>
</form>
<script type="text/javascript">
setTextField();
</script>
</body>
</html>