Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get form data

const loginForm = document.getElementById("login-form"); 
loginForm.addEventListener("submit", handleSubmit);

function handleSubmit(e) {
  e.preventDefault();
  const formData = new FormData(e.target);
  const formProps = Object.fromEntries(formData);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #form #data
ADD COMMENT
Topic
Name
6+5 =