Yep, again, hoopy is spot on :)
The *best* way to dynamically change minor details on your page, like enabling elements, is to use JavaScript.
(* Best in like 95% of cases, as not all browsers will have JavaScript enabled)
Simply create a <select> tag, and have the onchange event of that tag enable the box if the value of the selected option is set to a predefined value.
For example, you could put this into the <head></head> tags:
-
<script type="text/javascript">
-
function ToogleTextbox(pValue) {
-
var textBox = document.getElementById('OtherBox');
-
if(pValue) {
-
textBox.style.display = "block";
-
}
-
else {
-
textBox.style.display = "none";
-
}
-
}
-
</script>
-
This function would simply find the <input> with the
id "OtherBox", and then uses the display style to either show it or hide it.
And then do something like this for your <select> tag:
-
<select name="MySelect" onchange="javascript: ToogleTextbox(this.value == 'null');">
-
<option value="null">Other</option>
-
</select>
-
<input type="text" name="OtherBox" id="OtherBox" style="display: none;" />
-
Which basically tells your <select> element to call the ToogleTextbox function, and send a boolean value, indicating whether the <option> with the value "null" is selected.