Here i explain how to set textbox maximumlenght depends on dropdown selection. Follow the below simples steps to get the result.
Script snippet:
function drpchange() {
if ($('#<%=searchtooldrp.ClientID %> :selected').text() != "Emp Name") {
$('#<%=searchtooltxt.ClientID %>').attr("maxlength", "10");
}
}
HTML snippet:
Script snippet:
function drpchange() {
if ($('#<%=searchtooldrp.ClientID %> :selected').text() != "Emp Name") {
$('#<%=searchtooltxt.ClientID %>').attr("maxlength", "10");
}
}
HTML snippet: