Enable text box onchange drop down menu

Hi, How do you make a function that will enable a disabled text box when a user clicks “others” in the drop down menu… http://kabatak.ultradesigns.net/help.htm

Since you haven’t posted any code, I can’t provide a clearer solution. Essentially, you:

  1. Attatch an onChange event to your dropdown, which calls your evaluation function

  2. Each time the evaluation function is called, evaluate the selectedIndex

  3. If the selectedIndex is == to OTHER, then use the DOM to enable your textbox. Otherwise, disable your textbox.

thank you, im not really familiar with JS so i dont understand it fully but someone gave me the answer, in case anyone is interested, here it is.

<script language="javascript">
function dis_able()
{
	if(document.myform.D1.value != 'Others')
		document.myform.otherz.disabled=1;
	
	else
		document.myform.otherz.disabled=0;
}
</script>
<form name="myform">
  Category: <select size="1" name="D1" onChange="dis_able()">
  <option>Category A</option>
  <option>Category B</option>
  <option>Catagory C</option>
  <option value="Others">Others</option>
  </select><br>
  Others pls specify: <input disabled type="text" name="otherz" size="20" value="pls specify"></p>
  <p><input type="submit" value="Submit" name="B1"></p>
</form>