[jQuery] Re: serializeHash() instead of serializeArray()

2007-11-19 Thread Dan G. Switzer, II
>> I need some help by a jQuery internals hacker, because I don't really >> know how to add this particular feature that I need to jQuery: >> >> Sometimes I want to serialize a form to a Hash/Object in the form of: >> >> { key: 'val', key2: 'val2' } My Field plug-in offers this functionality: htt

[jQuery] Re: serializeHash() instead of serializeArray()

2007-11-18 Thread Gonzo
Just build it as a plugin: (function($) { $.fn.extend({ serializeHash: function() { var hash = {}; $.each(this.serializeArray(), function() { hash[this.name] = this.value; }); return hash; }