[jQuery] [PLUGIN] $().serialize
This plugin accepts a jQuery object containing form object and spits back a query string containing the values of the items passed, if any.
<span style="font-family: courier new,monospace;"> jQuery.fn.serialize = function() {
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> var array = new Array;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
this.each(function() { if(this.value) array.push(<a href="http://this.name">this.name</a> + "=" + this.value); });</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
return array.join("&");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }
example: $("input.clip:checked").serialize()<br clear="all">
</span>
--
Yehuda Katz
Web Developer
(ph) 718.877.1325
(fax) 718.686.4288
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/