You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using this checkbox, the checked and unchecked is reversed.
Look at this code <input id="chk" type="checkbox" checked) />
You will see that the "NO" has been selected. And when you use in the js it is totally wrong! The No will be "TRUE" and Yes will become "FALSE". $('#chk').checkboxpicker(); $('#chk').change(function () { alert ($(this).is(":checked")); }); $('#chk').prop('checked', false).trigger('change');
Any idea how to fix it?
Cheers
The text was updated successfully, but these errors were encountered:
I found the problem. The problem is that I am using "trigger" to ensure the "change event" is raised.
For quick workaround, I need to set the checked value to opposite value and then back to the actual value.
For example, the real value is FALSE, then do this: $('#chk').prop('checked', true); $('#chk').prop('checked', false);
As you can see, I've set the checked value to TRUE then set it back to FALSE.
When using this checkbox, the checked and unchecked is reversed.
Look at this code
<input id="chk" type="checkbox" checked) />
You will see that the "NO" has been selected. And when you use in the js it is totally wrong! The No will be "TRUE" and Yes will become "FALSE".
$('#chk').checkboxpicker();
$('#chk').change(function () { alert ($(this).is(":checked")); });
$('#chk').prop('checked', false).trigger('change');
Any idea how to fix it?
Cheers
The text was updated successfully, but these errors were encountered: