-
-
Save yeungon/2a4554620c1e4030aa393b71c540cdd1 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