[jQuery] Re: form pluggin bug?

2007-05-26 Thread Mike Alsup


Checkboxes are not serialized if they are not checked.  Is that the
issue?  That is the normal, expected behavior.  If you absolutely must
have the unchecked checkbox in your serialized string then you can
pass false to fieldSerialize:  $('#DB .HSCO').fieldSerialize(false);
But be aware that a normal browser submit will not do that so it's not
recommended.

Mike


On 5/26/07, oscar esp [EMAIL PROTECTED] wrote:


Versions are the same: IE 7 v .97

If I 'debug' the object I have:

INPUT class=HSFCO id=HSFCO_1 onclick=
\comercialViewField(this.value,'1');\ type=checkbox CHECKED value=1
name=HSFCO_1 metaDone=\true\

or:

INPUT class=HSFCO id=HSFCO_1 onclick=
\comercialViewField(this.value,'1');\ type=checkbox value=0
name=HSFCO_1 metaDone=\true\

It has one diference is the checked.


[jQuery] Re: form pluggin bug?

2007-05-25 Thread Mike Alsup


What browser is this happening on?  And what  version of the form
plugin?  It works fine for me on FF2 and IE7 using the latest form
plugin (.97).  This is what I tried:

htmlhead
script type=text/javascript src=jquery-1.1.2.js/script
script type=text/javascript src=jquery.form.js/script
script type=text/javascript
$(function() {
   $('button').click(function() {
   alert( $('#DB .HSCO').fieldSerialize() );
   return false;
   });
});
/script
/head
bodydivform id=DB action=
input type='checkbox' class='HSCO' id='HSCO_1' name='HSCO_1' value=1 /
input type='checkbox' class='HSCO' id='HSCO_2' name='HSCO_2' value=0 /
input type='checkbox' class='HSCO' id='HSCO_3' name='HSCO_3' value=1 /
buttonTest/button
/form/div/body
/html


Mike



On 5/25/07, oscar esp [EMAIL PROTECTED] wrote:


I am using fieldSerialize:

jQuery('#DB .HSCO').fieldSerialize();

In form DB I have 3 items:

input type='checkbox' class='HSCO' id='HSCO_1' name='HSCO_1' value=1
/td
input type='checkbox' class='HSCO' id='HSCO_2' name='HSCO_2' value=1
/td
input type='checkbox' class='HSCO' id='HSCO_3' name='HSCO_3' value=1
/td

if value is =1 then works fine however when value =0 (ex:HSCO_3)
the item doesn't appear in the serialization: HSCO_1=1HSCO_2=1

Any workaround?