Streaming live at 10am (PST)

Custom Form Submission

Hi,

Is there a way to customise the Webflow form action and submission, i.e. make an GET api call, redirect based of that GET result , and STILL submit the captured data to Webflow?

The use case is a postcode checker, where the user enters in a postcode and their email address, the website makes an api call to check if the postcode is valid. If so redirect to A, if not redirect to B. Their inputted information is posted to Webflow regardless.

This is what I have so far from looking across the Webflow forums and piecing it together. I’m making the API call successfully, but the submitted form details are not submitting to Webflow! Does anyone know why?

// Overide webflow form submission
var Webflow = Webflow || [];
Webflow.push(function () {
    // === Custom Form Handling ===
    makeWebflowFormAjax($("form"));
    $(document).off('submit');
     // new form handling
    $('form').submit(function (evt) {
    evt.preventDefault();
    });
}); 

Thanks in advance!

I believe if you override their default form hooks, by using your own, it won’t submit into Webflow’s form capture. But from the sound of it, you don’t want that default behavior anyways…

You can’t call the Webflow API directly from Javascript in the browser (it’s meant for a backend using something like Node.js).

If you’re open to using tools like Integromat/Zapier, this is totally doable without much effort.

Here’s a simple screencast of mine walking through how to setup this up…