View Single Post
Old 12-25-2004, 07:57 PM   #5 (permalink)
falsepride
Regular Contributor
 
Join Date: Oct 2004
Posts: 209
falsepride is on a distinguished road
Hell yes! Screw a week, i got it working in under an hour. Im pretty sure the code below will do what you want. Works in IE, opera, and mozilla.

Code:
<script language="JavaScript">
function prompt_option(obj) {
  if(obj.value == "other") {
    var other= prompt('Please enter ...........', ' ');
    document.forms["form1"].dropdown.options["4"] = null;
    document.forms["form1"].dropdown.options["4"] = new Option(other, other, false, true);
  }
}
</script> 
<form method="" action="" name="form1">
<select size="1" name="dropdown" onChange="prompt_option(this)">
<option value="chioce1">chioce1</option>
<option value="choice2">choice2</option>
<option value="choice3">choice3</option>
<option value="choice4">choice4</option>
<option value="other">other</option>
</select>
falsepride is offline   Reply With Quote