Works fine. Thanks

On Jul 11, 9:32 pm, "Dan G. Switzer, II" <[EMAIL PROTECTED]>
wrote:
> >Is there a bug with formHash() and radio buttons? Or am I missing the
> >obvious.  With this form
>
> Change the hashForm to:
>
>         $.fn.formHash = function(inHash){
>                 var bGetHash = (arguments.length == 0);
>                 // create a hash to return
>                 var stHash = {};
>
>                 // run the code for each form
>                 this.filter("form").each(
>                         function (){
>                                 // get all the form elements
>                                 var els = this.elements, el, n, stProcessed
> = {}, jel;
>
>                                 // loop through the elements and process
>                                 for( var i=0, elsMax = els.length; i <
> elsMax; i++ ){
>                                         el = els[i], n = el.name;
>
>                                         // if the element doesn't have a
> name, then skip it
>                                         if( !n || stProcessed[n] ) continue;
>
>                                         // create a jquery object to the
> current named form elements
>                                         var jel = $(el.tagName.toLowerCase()
> + "[EMAIL PROTECTED]'"+n+"']", this);
>
>                                         // if we're getting the values, get
> them now
>                                         if( bGetHash ){
>                                                 stHash[n] =
> jel[defaults.useArray ? "fieldArray" : "getValue"]();
>                                         // if we're setting values, set them
> now
>                                         } else if( !!inHash[n] ){
>                                                 jel[defaults.useArray ?
> "fieldArray" : "setValue"](inHash[n]);
>                                         }
>
>                                         stProcessed[n] = true;
>                                 }
>                         }
>                 );
>
>                 // if getting a hash map return it, otherwise return the
> jQuery object
>                 return (bGetHash) ? stHash : this;
>         }
>
> Let me know if that works correctly. It is in my testing.
>
> -Dan

Reply via email to