I have some code on changing the checkbox that toggles some UI on/off, that piece is working fine per this code
$('input[name="leave_type[validate_balance]"]').change(function() {
$('#threshold_options').toggle($(this).prop('checked'));
});
If I try and grab the value on init, it is always false, no matter what's been saved, how do I get the state of the checkbox on first load? Everything else works perfectly.
$('input[name="leave_type[validate_balance]"]').init(function() {
// Always false
alert($('input[name="leave_type[validate_balance]"]').prop('checked'));
});
I have some code on changing the checkbox that toggles some UI on/off, that piece is working fine per this code
If I try and grab the value on init, it is always false, no matter what's been saved, how do I get the state of the checkbox on first load? Everything else works perfectly.