I'm using the following code, and for some reason i can't get it to work. I want it so that when the user Selects South Africa, it disables Flight Option 2. Can someone please help me, I don't see where I'm going wrong...
Header:
<SCRIPT LANGUAGE="JavaScript">
function Disab(val) {
if(val=="Australia")
{document.form1.flight_options[0].disabled=false;document.form1.flight_options[1].disabled=false}
if(val=="New Zealand")
{document.form1.flight_options[0].disabled=false;document.form1.flight_options[1].disabled=false}
if(val=="South Africa")
{document.form1.flight_options[0].disabled=false;document.form1.flight_options[1].disabled=true}
}
</SCRIPT>
Form:
<select name="country" onChange="Disab(this.value)">
<option value="Australia">Australia</option>
<option value="New Zealand">New Zealand</option>
<option value="South Africa">South Africa</option>
</select>
<input type="radio" name="flight_option" value="Option 1" />Flight Option 1
<input type="radio" name="flight_option" value="Option 2" />Flight Option 2
Header:
<SCRIPT LANGUAGE="JavaScript">
function Disab(val) {
if(val=="Australia")
{document.form1.flight_options[0].disabled=false;document.form1.flight_options[1].disabled=false}
if(val=="New Zealand")
{document.form1.flight_options[0].disabled=false;document.form1.flight_options[1].disabled=false}
if(val=="South Africa")
{document.form1.flight_options[0].disabled=false;document.form1.flight_options[1].disabled=true}
}
</SCRIPT>
Form:
<select name="country" onChange="Disab(this.value)">
<option value="Australia">Australia</option>
<option value="New Zealand">New Zealand</option>
<option value="South Africa">South Africa</option>
</select>
<input type="radio" name="flight_option" value="Option 1" />Flight Option 1
<input type="radio" name="flight_option" value="Option 2" />Flight Option 2