I think formHash() doesn't do radio buttons correctly. My fix was to
replace

          // if we're getting the values, get them now
          if( bGetHash ){
            stHash[n] = $(el)[defaults.useArray ? "fieldArray" :
"getValue"]();

in $.fn.formHash() with

          // if we're getting the values, get them now
          if( bGetHash ){
            var val = $(el)[defaults.useArray ? "fieldArray" :
"getValue"]();

            // a radio button's value is the "or" of all its values
            stHash[n] = (getType(el) == "radio") ? stHash[n] || val :
val;

Totally off-base?


On Jul 3, 10:50 am, "Dan G. Switzer, II" <[EMAIL PROTECTED]>
wrote:
> I've updated my Field Plug-in with a new method calledformHash():
>
> http://jquery.com/plugins/project/field
>
> TheformHash() method allows you to easily grab all the values in your form
> as a hash map/structure or you can set the fields in your form based upon a
> hash map/structure of values.
>
> TheformHash() method is a perfect companion to AJAX JSON
> operations--allowing you to easily fill in a form based upon a JSON packet.
>
> Examples:
> $("#formName").formHash();
> Returns a hash map of all the form fields and their values.
>
> $("#formName").formHash({"name": "Dan G. Switzer, II", "state": "OH"});
> Returns the jQuery chain and sets the fields "name" and "state" with the
> values "Dan G. Switzer, II" and "OH" respectively.
>
> -Dan

Reply via email to