handle JSON boolean values for checkboxes true/false values
Opened this issue · 2 comments
interloper10 commented
I think you could add the following to support JSON boolean values for checkboxes.
This is currently a string comparison only @~line 208
// Handle select menus, checkboxes and radio buttons
} else if ( property == "checked" || property == "selected" ) {
var fields = [];
var type;
...
$.each( fields, function( index, field ) {
//next 2 lines added to fix JSON boolean values for checkboxes true/false values
type = typeof value;
if ((type === 'boolean' && value.toString() === field.value) || ( field.value == value )) {
field[ property ] = true;
callback.call( field, value );
}
});
kflorence commented
@interloper10 can you add a failing test case for this?
interloper10 commented
Hi Kyle - I will try to do this. I just get into this again and find
another potential issue. If you load a form using an ajax call, the form
may never get refreshed (values reset). It would be best to explicitly set
checkboxes and selects to both true and false depending on the boolean
value.
I will work on this and keep you updated.
Russ
…On Sat, Sep 16, 2017 at 2:31 PM, Kyle Florence ***@***.***> wrote:
@interloper10 <https://github.com/interloper10> can you add a failing
test case for this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#43 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AG1c8ye8gxemlQOCfnqn09JPGyI3JatTks5sjBQCgaJpZM4O6udc>
.