For exmple we have following form
<form id="ff" method="post">
<input type="checkbox" name="is_active" value="true" />
</form>
And code
$('#ff').form('load',{
is_active:true
});
This code will set checkbox state to checked but nothing happens, and when we change code to
$('#ff').form('load',{
is_active:'true'
});
it works fine
Then i looked at jquery.form.js
there is code for checkbox and radio
var rr = $("input[name=\""+_17+"\"][type=radio], input[name=\""+_17+"\"][type=checkbox]",_18);
$.fn.prop ? rr.prop("checked",false) : rr.attr("checked",false);
rr.each(function(){
var f=$(this);
if(f.val()==val){
$.fn.prop ? f.prop("checked",true) : f.attr("checked",true);
}
});
when we have is_active:true
in line
if(f.val()==val){
comparsion string==bool witch returns false anytimes for boolean values
There we need change it to
if(f.val()==String(val)){
to valid value comparsion