From 4414a338c6dc25b5128b8d546337a9d8343ef468 Mon Sep 17 00:00:00 2001 From: FinesseRus Date: Wed, 25 Mar 2015 19:46:42 +0900 Subject: [PATCH 1/2] Outside fields bug fix In non-IE browsers outside fields are already included in `elements` attribute of form, so there is no need to add outside fields again. --- jquery.form.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jquery.form.js b/jquery.form.js index 591ad6f1..0c78af0f 100644 --- a/jquery.form.js +++ b/jquery.form.js @@ -955,7 +955,8 @@ $.fn.formToArray = function(semantic, elements) { } // #386; account for inputs outside the form which use the 'form' attribute - if ( formId ) { + // FinesseRus: in non-IE browsers outside fields are already included in form.elements. + if (formId && (semantic || /MSIE/.test(navigator.userAgent))) { els2 = $(':input[form="' + formId + '"]').get(); // hat tip @thet if ( els2.length ) { els = (els || []).concat(els2); From f4c43b0308c0b9e70907077cadc382efef0669d9 Mon Sep 17 00:00:00 2001 From: Surgie Date: Tue, 7 Mar 2017 10:25:52 +1000 Subject: [PATCH 2/2] Improved wrong form.elements browsers detection --- jquery.form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.form.js b/jquery.form.js index 0c78af0f..d55b7e85 100644 --- a/jquery.form.js +++ b/jquery.form.js @@ -956,7 +956,7 @@ $.fn.formToArray = function(semantic, elements) { // #386; account for inputs outside the form which use the 'form' attribute // FinesseRus: in non-IE browsers outside fields are already included in form.elements. - if (formId && (semantic || /MSIE/.test(navigator.userAgent))) { + if (formId && (semantic || /(Edge|Trident)\//.test(navigator.userAgent))) { els2 = $(':input[form="' + formId + '"]').get(); // hat tip @thet if ( els2.length ) { els = (els || []).concat(els2);