Examples

This guide outlines various methods for submitting the form.

You can access your form's endpoint by navigating to the following path:
dashboard -> Forms -> "Any Form" -> Setup.

HTML

After clicking Submit the user will be redirected to the default "Thank You" page or a custom URL if configured.

For a detailed overview of potential responses from your form's endpoint, refer to the documentation here.

Remember to include enctype="multipart/form-data" in your form element.
HTML
<form action="{your_form_endpoint}" method="POST" enctype="multipart/form-data">
  <label>
    Email:
    <input type="email" name="email" />
  </label>

  <label>
    Name:
    <input type="text" name="name" />
  </label>

  <label>
    Message:
    <textarea name="message"></textarea>
  </label>

  <label>
    File:
    <input type="file" name="file" />
  </label>

  <button type="submit">Submit</button>
</form>

JSON using JavaScript

For a detailed overview of potential responses from your form's endpoint, refer to the documentation here.

Uploading files isn't supported in JSON.
JavaScript
const data = {
  email: "test@vexrun.com",
  name: "John Doe",
  message: "Hello!",
};

const res = await fetch("{your_form_endpoint}", {
  method: "POST",
  headers: {
    Accept: "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(data),
});

const json = await res.json();
console.log(json);

FormData using JavaScript

For a detailed overview of potential responses from your form's endpoint, refer to the documentation here.

JavaScript
const data = new FormData();
data.append("email", "test@vexrun.com");
data.append("name", "John Doe");
data.append("message", "Hello!");

const file = document.querySelector("input[name=file]").files[0];
data.append("file", file);

const res = await fetch("{your_form_endpoint}", {
  method: "POST",
  headers: {
    Accept: "application/json",
  },
  body: data,
});

const json = await res.json();
console.log(json);

On this page