Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dropdownlist change in asp.net

Status
Not open for further replies.

nomu26

Programmer
Sep 10, 2003
22
ZA
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=&quot;form1&quot; method=&quot;post&quot;>
<input name=&quot;mytext&quot; type=&quot;text&quot;>
<select name=&quot;mySelect&quot; onchange=&quot;javascript: return freeze();&quot;>
<option value=&quot;&quot;></option>
<option value=&quot;A&quot;>Individual</option>
<option value=&quot;B&quot;>Other</option>
</select>
<input type=&quot;submit&quot;>
</form>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top