Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…s handled by plugins. Fixes #13306.
  • Loading branch information...
commit 21af3a9213a2ad0f9996f2ef4f2d8ee53a3f45d4 1 parent bb1d148
Timmy Willison authored January 23, 2013
2  src/serialize.js
... ...
@@ -1,7 +1,7 @@
1 1
 var r20 = /%20/g,
2 2
 	rbracket = /\[\]$/,
3 3
 	rCRLF = /\r?\n/g,
4  
-	rsubmitterTypes = /^(?:submit|button|image|reset)$/i,
  4
+	rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
5 5
 	rsubmittable = /^(?:input|select|textarea|keygen)/i;
6 6
 
7 7
 jQuery.fn.extend({
5  test/unit/serialize.js
@@ -112,8 +112,9 @@ test("serialize()", function() {
112 112
 
113 113
 	// Add html5 elements only for serialize because selector can't yet find them on non-html5 browsers
114 114
 	jQuery("#search").after(
115  
-		"<input type='email' id='html5email' name='email' value='dave@jquery.com' />"+
116  
-		"<input type='number' id='html5number' name='number' value='43' />"
  115
+		"<input type='email' id='html5email' name='email' value='dave@jquery.com' />" +
  116
+		"<input type='number' id='html5number' name='number' value='43' />" +
  117
+		"<input type='file' name='fileupload' />"
117 118
 	);
118 119
 
119 120
 	equal( jQuery("#form").serialize(),

0 notes on commit 21af3a9

Please sign in to comment.
Something went wrong with that request. Please try again.