chrismassey
Programmer
Hello,
I need to disable a textbox if a particular menu option has been selected. Basically, I have a form where the user has 2 choices... 1) Type the information into the textbox, OR, 2) Select the information from the drop down menu. If they have selected an option from the drop down menu then obviously I want to stop them from being able to then enter information into the textbox "twice" by disabling it. If the first option is selected then the textbox must remain enabled. My code below doesn't seem to work and I am unsure why. Any suggestions?
Thanks Alot,
Chris
I need to disable a textbox if a particular menu option has been selected. Basically, I have a form where the user has 2 choices... 1) Type the information into the textbox, OR, 2) Select the information from the drop down menu. If they have selected an option from the drop down menu then obviously I want to stop them from being able to then enter information into the textbox "twice" by disabling it. If the first option is selected then the textbox must remain enabled. My code below doesn't seem to work and I am unsure why. Any suggestions?
Code:
<html>
<head>
<title></title>
</head>
<body>
<form name="TitleForm">
<input type="text" name="Add_To_Title_Other">
<select name="Add_To_Title_Other_Menu">
<option value="0"> >>> </option>
<option value="1" onClick="javascript:document.TitleForm.Add_To_Title_Other.disabled=true"> One </option>
<option value="2" onClick="javascript:document.TitleForm.Add_To_Title_Other.disabled=true"> Two </option>
<option value="3" onClick="javascript:document.TitleForm.Add_To_Title_Other.disabled=true"> Three </option>
</select>
</form>
</body>
</html>
Thanks Alot,
Chris