jquery code for checkbox in MVC
jquery function: It is returning true always in alert(isChecked) even when
unchecked.
$('.accrualCheckbox').click(function () {
var isChecked = $(this).attr('checked') ? true : false;
alert($(this).attr('checked'));
alert(isChecked);
if ($(this).prop('checked', 'checked')) {
var parentDiv = $(this).parents('.searchLine');
$(parentDiv).css('border', '1px solid red');
//Checkbox
$(parentDiv).find("input[type=text]").each(function () {
$(this).val('B');
$(this).prop('disabled', true);
});
}
});
});
i have kept check box in div ,
<div class="accrualCheckbox">
@Html.CheckBox("chkSalesAndMarketing")
</div>
No comments:
Post a Comment