This article provides detailed instructions on successfully sending form data to a Zapier catch webhook using a JavaScript function for form submission.
Published
Jun 1, 2025
<form onSubmit={handleSubmit}>
<input name="firstName" id="firstName" type="text">
<input name="lastName" id="lastName" type="text">
<!-- more fields here -->
<button type="submit">Submit</button>
</form>const handleSubmit = async (e) => {
e.preventDefault();
const data = {
firstName: e.target.firstName.value,
lastName: e.target.lastName.value,
// etc..
}
// Send the data to the server in JSON format.
const JSONdata = JSON.stringify(data);
// API endpoint where we send form data.
const endpoint = 'YOUR ZAPIER WEBHOOK URL';
// Form the request for sending data to the server.
const options = {
method: 'POST',
body: JSONdata,
};
// Send the form data to our endpoint url
const response = await fetch(endpoint, options);
if (response.ok) {
console.log("Form submitted successfully");
} else {
console.error("Form submission failed");
}
}Create a new zap.
Add the trigger called Webhooks by Zapier (this is a premium app).
Select the 'Catch Hook' event and leave the 'Pick off child key' field blank
Table of Contents
Table of Contents
Website Services
Marketing Services
Demand Stack, All Rights Reserved 2026