I have checkbox which once it's property of clicked is true, I would like to check another checkbox automatically.
I managed to partially get it working by changing the other value of the checkbox to true whenever the other is clicked. But this isn't what I want. I'd like to be able to check when the 'TwoFChk' checkbox is clicked and also if the property of checked is true at the same time. How do I do this?
JQuery:
if ($('#TwoFChk').change(function () {
if ($(this).prop('checked', true)) {
alert("It's checked");
$('#ConfirmEmailChk').prop('checked', true);
}
}));
My question is different, here's why:
I'm not just trying to check if a checkbox is checked. I can do that already. I need to detect when the value of checked changes, and if the value of checked is then true. I need to change the checked value of another checkbox is true. Again, I am not just trying to check if a checkbox is checked. I need to have an on click of the checkbox and if the checkbox checked value is true, then I need to check another checkbox.