From 21af3a9213a2ad0f9996f2ef4f2d8ee53a3f45d4 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Wed, 23 Jan 2013 12:21:48 -0500 Subject: [PATCH] Ignore file inputs when serializing forms. File input serialization is handled by plugins. Fixes #13306. --- src/serialize.js | 2 +- test/unit/serialize.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/serialize.js b/src/serialize.js index 6e8353d59..65dee4005 100644 --- a/src/serialize.js +++ b/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({ diff --git a/test/unit/serialize.js b/test/unit/serialize.js index ab5d1c427..eff2a0086 100644 --- a/test/unit/serialize.js +++ b/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( - ""+ - "" + "" + + "" + + "" ); equal( jQuery("#form").serialize(), -- 2.39.5