I’m hoping this is just something silly that I’m doing or something I’m just not aware of. But, how do I get the current value from a jqxCheckBox widget when it’s being clicked?
Doing the following doesn’t work as expected:
$('myCheckbox').jqxCheckBox();$('myCheckbox').on('click', function(event) { var mybool = $(this).val();});
The value of mybool will always be the opposite of what it should be. So, clicking the checkbox to tick it, this value is false. But it is only false during the click event. After that calls to val() return true as expected. I’m assuming this is because the internal value is changed until after the click event is fired.
a) Is there some other way to get the value during the click event?
or
b) is it safe to just invert the value? This isn’t exactly ‘tidy’, but could be a valid work around.
I guess, how are others getting the value of a checkbox from inside a click event?