I have added the followng code to disable the dropdown on unchecking the checkbox in jQuery, but the checkbox is not retaining the value:
$(document).ready(function(){
//on check of the checkbox,the dropdown is enabled or disabled.
$("[id$=chkCashSettlementType]").toggle(
function()
{
$("[id$=ddlSettlementCurrency]").attr('disabled',$("[id$=chkCashSettlementType]").not(':checked'));
$("[id$=chkCashSettlementType]").attr('checked',false);
},
function()
{
$("[id$=ddlSettlementCurrency]").removeAttr('disabled');
$("[id$=chkCashSettlementType]").attr('checked',true);
}
)
});
Where did I go wrong?