I've created a dropdownlist which populates from the database and I need to validate three textboxed if "Individual" is selected but if anything other than individual the three textboxes must be freezed - I've done the code and tested it on the asp page by calling the function on the control but my application is on asp.net and it doesn't allow me to call the function on the dropdownlist control bringing up an error that "javascript does not support MyPage.aspx" - here the code remember it works perfectly on html and asp page but not on asp.net:
function freeze(){
if(document.form1.mySelect.options[document.form1.mySelect.selectedIndex].value != "A"{
document.form1.mytext.value="";
document.form1.mytext.disabled=true;
}
}
</script>
</head>
<body>
<form name="form1" method="post">
<input name="mytext" type="text">
<select name="mySelect" onchange="javascript: return freeze();">
<option value=""></option>
<option value="A">Individual</option>
<option value="B">Other</option>
</select>
<input type="submit">
</form>
function freeze(){
if(document.form1.mySelect.options[document.form1.mySelect.selectedIndex].value != "A"{
document.form1.mytext.value="";
document.form1.mytext.disabled=true;
}
}
</script>
</head>
<body>
<form name="form1" method="post">
<input name="mytext" type="text">
<select name="mySelect" onchange="javascript: return freeze();">
<option value=""></option>
<option value="A">Individual</option>
<option value="B">Other</option>
</select>
<input type="submit">
</form>