Created
January 16, 2023 18:14
-
-
Save skinnyfads/33f034bf2e1d530dda5bcef4169558b6 to your computer and use it in GitHub Desktop.
Get all value form data on submit
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
yourForm.onsubmit = (event) => { | |
event.preventDefault(); | |
const formData = new FormData(yourForm); | |
for (const [key, value] of formData) { | |
console.log({ key, value }); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment