Formdata Snippet

up:: JavaScript

const submitHandler = async (event: Event) => {
  const target = event.target as HTMLFormElement;
  const formData = new FormData(target);
  const formProps = Object.fromEntries(formData);
  target.reset();
  console.log(formProps);
};