Search
 
SCRIPT & CODE EXAMPLE
 

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);
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: omit object javascript 
Javascript :: how to filter an array of strings to see which letters match javascript 
Javascript :: How to concatenate two textbox values in JavaScript 
Javascript :: jvectormap color regions 
Javascript :: dividing a number into digits javascript 
Javascript :: separador de miles javascript 
Javascript :: split by space capital letter or underscore javascript 
Javascript :: remove property from object javascript 
Javascript :: react class component input text with clear button 
Javascript :: js contains 
Javascript :: duplicate images in webpage js 
Javascript :: remove all chars from string and leave only numbers javascript and leav space betwin numbers 
Javascript :: hot get access_token instead of url 
Javascript :: svg event listeners 
Javascript :: const { something} javascript 
Javascript :: set token to expiration with passport jwt. 
Javascript :: heroku proxy cross origin 
Javascript :: index of javascript 
Javascript :: string to char code array javascript 
Javascript :: esbuild 
Javascript :: Open props 
Javascript :: spring boot map json to object in controller 
Javascript :: nodejs ERR_CONNECTION_REFUSED 
Javascript :: alert by code stackoverflow 
Javascript :: selected option using javascript 
Javascript :: js addeventlistener input searcb mobile 
Javascript :: bouton scroll en haut 
Javascript :: last index of string in javascript 
Javascript :: javascript detect paste contents 
Javascript :: prettier overrides 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =