We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d235e9a commit 34fbed7Copy full SHA for 34fbed7
jquery.form.js
@@ -912,8 +912,21 @@ $.fn.formToArray = function(semantic, elements) {
912
}
913
914
var form = this[0];
915
+ var formId = this.attr('id');
916
var els = semantic ? form.getElementsByTagName('*') : form.elements;
- if (!els) {
917
+ var els2;
918
+
919
+ if ( els )
920
+ els = $(els).get(); // convert to standard array
921
922
+ // #386; account for inputs outside the form which use the 'form' attribute
923
+ if ( formId ) {
924
+ els2 = $(':input[form=' + formId + ']').get();
925
+ if ( els2.length )
926
+ els = (els || []).concat(els2);
927
+ }
928
929
+ if (!els || !els.length) {
930
return a;
931
932
0 commit comments