Title: Bug in form load (checkbox) Post by: anton.dutov on March 31, 2012, 05:59:42 PM For exmple we have following form
Code: <form id="ff" method="post"> And code Code: $('#ff').form('load',{ This code will set checkbox state to checked but nothing happens, and when we change code to Code: $('#ff').form('load',{ Then i looked at jquery.form.js there is code for checkbox and radio Code: var rr = $("input[name=\""+_17+"\"][type=radio], input[name=\""+_17+"\"][type=checkbox]",_18); when we have is_active:true in line Code: if(f.val()==val){ There we need change it to Code: if(f.val()==String(val)){ Title: Re: Bug in form load (checkbox) Post by: Kevin on April 04, 2012, 08:54:32 PM Hi Anton
I don't think this is a bug. You have defined your value as a string (value="true"). In the same way you could define this as value="1". Thus to set the check box, you would have; $('#ff').form('load',{ is_active:'1' }); Technically there is no boolean type true in HTML, which might be confusing you. Title: Re: Bug in form load (checkbox) Post by: anton.dutov on April 12, 2012, 06:25:07 AM Hi Kevin,
But usually chekcbox represent bool values and form loads values from json-notation direcly, i think no problems there to change behavior in this case. |