If you don't want to redirect your form submitters after a submission, FetchAPI is another option we support. Fetch API is similar to XMLHttpRequest but this new API provides powerful features.

While setting up your Getform form endpoints keep in mind that Internet Explorer still does not have compatibility with fetch api, so you may want to think twice to use it in production.

JSON Request Using Fetch API

Assuming you have a simple HTML as follows:

<form  id="form" action="">
    <input type="text" name="name" placeholder="Name">
    <input type="email" name="email" placeholder="Email">
    <button type="submit">Send</button>

Let's make a simple request to submit above HTML formData using FetchAPI:

   var form = document.getElementById("form");
   form.addEventListener("submit", formSubmit);
   function formSubmit(e) {
       const formData = new FormData();
           method: "POST",
           body: formData,
       .then(response => console.log(response))
       .catch(error => console.log(error))


{type: "cors", url: "https://getform.io/thank-you", redirected: true, status: 200, ok: true,}

Remember to change the form endpoint with yours on the fetch().

FetchAPI Support is available on Start and Grow plans.