Last active
December 17, 2016 14:33
-
-
Save abramovantonru/01fc56556b54f28315f36487f59669f1 to your computer and use it in GitHub Desktop.
merge form data on js {js, form, serialize, merge}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get data from many forms | |
* Work in IE11+ and work with file ajax upload | |
*/ | |
var | |
data = new FormData($('#form1')[0]), | |
form_2 = $('#form2').serializeArray(); | |
form_2.forEach(function(fields){ | |
data.append(fields.name, fields.value); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment