]> source.dussan.org Git - jquery.git/commitdiff
Ignore file inputs when serializing forms. File input serialization is handled by...
authorTimmy Willison <timmywillisn@gmail.com>
Wed, 23 Jan 2013 17:23:46 +0000 (12:23 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Wed, 23 Jan 2013 17:23:46 +0000 (12:23 -0500)
src/serialize.js
test/unit/serialize.js

index 6e8353d591e9af51858497d7679c6a1cbded1785..65dee4005b8010a0e7e89da16cafc729a1e5cc06 100644 (file)
@@ -1,7 +1,7 @@
 var r20 = /%20/g,
        rbracket = /\[\]$/,
        rCRLF = /\r?\n/g,
-       rsubmitterTypes = /^(?:submit|button|image|reset)$/i,
+       rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
        rsubmittable = /^(?:input|select|textarea|keygen)/i;
 
 jQuery.fn.extend({
index ab5d1c4271f5cf4ca0c7d40a23991b0508a65660..eff2a0086921d28238e5ae1cbc0ca734901375a9 100644 (file)
@@ -112,8 +112,9 @@ test("serialize()", function() {
 
        // Add html5 elements only for serialize because selector can't yet find them on non-html5 browsers
        jQuery("#search").after(
-               "<input type='email' id='html5email' name='email' value='dave@jquery.com' />"+
-               "<input type='number' id='html5number' name='number' value='43' />"
+               "<input type='email' id='html5email' name='email' value='dave@jquery.com' />" +
+               "<input type='number' id='html5number' name='number' value='43' />" +
+               "<input type='file' name='fileupload' />"
        );
 
        equal( jQuery("#form").serialize(),