Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

recover form data in json

document.querySelector('form') // Your form
  .addEventListener('submit', e => {
  	e.preventDefault();
  	const data = Object.fromEntries(
      new FormData(e.target)
    );
  	// Store it as JSON
  	const jsonData = JSON.stringify(data);
});
 
PREVIOUS NEXT
Tagged: #recover #form #data #json
ADD COMMENT
Topic
Name
9+7 =