Created
March 17, 2017 11:22
-
-
Save everdimension/87228e9ebab82b84afcdc7794fde3bfd to your computer and use it in GitHub Desktop.
A way to collect form data without `FormData` api.
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
handleSubmit(event) { | |
const form = event.target; | |
const data = {} | |
for (let element of form.elements) { | |
if (element.tagName === 'BUTTON') { continue; } | |
data[element.name] = element.value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! 👍