Reputation: 31
I have this code but it doesn't work with asp.net page which has a master page along with ajax control toolkit(I have included ToolScriptManager). The code is
<script type="text/javascript">
jQuery(function() {
$("#<%=RadioButtonList1.ClientID%>").change(function() {
var rbvalue = $("input[@name=<%=RadioButtonList1.UniqueID%>]:radio:checked").val();
if (rbvalue == "No") {
$("#DropDownList1").attr("disabled", false);
}
else if (rbvalue == "Yes") {
$("#DropDownList1").attr("disabled", true);
}
});
});
</script>
Upvotes: 3
Views: 3281
Reputation: 11
<script type="text/javascript">
$(document).ready(function() {
$('#RadioButtonList1').change(function() {
var rbvalue = $('#RadioButtonList1').val();
if (rbvalue == "No") {
$('#DropDownList1').attr('disabled', false);
}
else if (rbvalue == "Yes") {
$('#DropDownList1').attr('disabled', true);
}
});
});
</script>
Upvotes: 1
Reputation: 1301
If it works fine without the Master Page, you have to look at what that might change. The easiest answer is that it introduces a javascript bug that causes the rest of the code not to execute. I'd try a few things:
Upvotes: 0