Hello all,
I’m fairly new to scripting, although I’ve beeing with css & html for many years. I have created a form which has about 9-10 various input fields. One of the fields is a drop down menu, where the last option is “other”. If someone selects this option, I want another text input field to appear below.
Here’s what I have so far, but it’s not working. Can anyone please help me?!?!
<select name=”Title>
<option name=”provider” value=”Select” selected=”selected”>Select One</option>
<option name=”blah” value=”1″>1</option>
<option name=”blah” value=”2″>2</option>
<option name=”provider” value=”3″>ASP-One</option>
<option name=”provider” value=”4″>Intermedia</option>
<option name=”provider” value=”5″>LanLogic</option>
<option name=”provider” value=”5″>Mi8</option>
<option name=”provider” value=”6″>USA.net</option>
<option id=”OtherSelect” name=”blah” value=”Other” onclick=”swapform();”>Other</option>
</select>
<input id=”OtherField” type=”text” value=”” size=”20″ style=”visibility: hidden”>
<script>
function swapform() {
var visable
var hidden
visable = document.getElementById(“OtherSelect”).innerHTML;
hidden = document.getElementById(“OtherField”).innerHTML;
document.getElementById(“OtherSelect”).innerHTML = hidden;
}
</script>
Thx!! ?