Skip to content

Instantly share code, notes, and snippets.

@scsskid
Last active June 2, 2021 14:30
Show Gist options
  • Save scsskid/7d669ec17b71730637bc70a766373fb2 to your computer and use it in GitHub Desktop.
Save scsskid/7d669ec17b71730637bc70a766373fb2 to your computer and use it in GitHub Desktop.
[Parse HTML FormData] #forms
function parseFormData(formData) {
const formEntries = new FormData(formData).entries();
const data = {};
for (var [formElementName, value] of formEntries) {
data[formElementName] = value;
}
return data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment