Skip to content

Commit

Permalink
Ignore file inputs when serializing forms. File input serialization i…
Browse files Browse the repository at this point in the history
…s handled by plugins. Fixes #13306.
  • Loading branch information
timmywil committed Jan 23, 2013
1 parent b326225 commit caac041
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 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({
Expand Down
5 changes: 3 additions & 2 deletions test/unit/serialize.js
Expand Up @@ -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(),
Expand Down

0 comments on commit caac041

Please sign in to comment.