X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=form%2Fform.js;h=f391fcf1751727893a0a992563db46063fe2b6e2;hb=0a4dc3f8f295d10bbe855a11f52931c6c979e29e;hp=640437444e1921f5feb5d8d0cee0a50a5b7963cf;hpb=b5a1e0c8a6f06ae774e3d461f8d499a8049d9383;p=jquery.git diff --git a/form/form.js b/form/form.js index 6404374..f391fcf 100644 --- a/form/form.js +++ b/form/form.js @@ -127,6 +127,19 @@ $.fn.ajaxForm = function(target, post_cb, pre_cb) { }); }; +/* + +$.ajax({ + type: "POST", + url: "foo.cgi", + data: $.param( $("form").formdata() ), + success: function(){}, + error: function(){}, + complete: function(){} +}); + + */ + /** * A simple wrapper function that sits around the .serialize() * method, allowing you to easily extract the data stored within @@ -198,7 +211,7 @@ $.fn.serialize = function() { if ((p == 'SELECT' || p == 'OPTGROUP') && !this.selected) return; var n = this.name; - if (!n) n = (p == 'OPTGROUP') ? par.parentNode.name : par.name; + if (!n) n = (p == 'OPTGROUP') ? par.parentNode.name : (p == 'SELECT') ? par.name : this.name; if (n == undefined) return; a.push({name: n, value: this.value});