Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ignore file inputs when serializing forms. File input serialization i…

…s handled by plugins. Fixes #13306.
  • Loading branch information...
commit 21af3a9213a2ad0f9996f2ef4f2d8ee53a3f45d4 1 parent bb1d148
@timmywil timmywil authored
Showing with 4 additions and 3 deletions.
  1. +1 −1  src/serialize.js
  2. +3 −2 test/unit/serialize.js
View
2  src/serialize.js
@@ -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({
View
5 test/unit/serialize.js
@@ -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(),
Please sign in to comment.
Something went wrong with that request. Please try again.