i'm not sure if you can hide the optional text field, unless you're using lotus notes, OR want to use javascript to document.write each line dependent on the selection, and that can get busy and messy. maybe good way in js, just none that i can think of.
could disable the field, it'll show up 🙁 but least not be editable. (of course, won't work in ns4.x, but not much does):
<script language="JavaScript" type="text/javascript">
<!--
function fieldOneDisable() {
window.document.formname.fieldOne.disabled = true;
}
function getValue() {
value = window.document.formname.selectList.options.selectedIndex;
if (value == 3) {
window.document.formname.fieldOne.disabled = false;
} else {
window.document.formname.fieldOne.disabled = true;
}
}
//-->
</script>
<body onload="fieldOneDisable()">
<form name="formname">
Pick one:<select name="selectList" onchange=getValue();>
<option>foo1</option>
<option>foo2</option>
<option>foo3</option>
<option>other</option>
</select>
<p>
Other: <input type="text" name="fieldOne">
</form>
</body>