Created
February 16, 2021 18:25
-
-
Save tdr2d/cee3101898fa3c38efeaf7ff75fbf937 to your computer and use it in GitHub Desktop.
Javascript vanilla utils
This file contains 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
function serializeForm(form) { // Serialize inputs values into json object | |
var obj = {}; | |
var formData = new FormData(form); | |
for (var key of formData.keys()) { | |
obj[key] = formData.get(key); | |
} | |
return obj; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment