Created
April 26, 2021 18:46
-
-
Save Orbis25/a1ec87bae5579500a6de4c5591523cda to your computer and use it in GitHub Desktop.
Convert html form to json.
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
/** | |
* Convert form to json | |
* @param {Event} event evento del formulario | |
*/ | |
const FormToJson = async (event) => { | |
event.preventDefault(); | |
const data = new FormData(event.target) | |
const values = Object.fromEntries(data.entries()); | |
return values | |
} |
Author
Orbis25
commented
Apr 26, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment