Streaming live at 10am (PST)

Passing data to / from a Webflow form


#1

I have a few general Webflow form questions, and a specific one below:

General Questions

  1. Is there a way to return data to a Webflow page? Say for example that I POST the data to a custom action URL or API endpoint where I want to process the form input in some way, then return a message. Can I capture and display that?

  2. How do you handle error messaging for custom action URLs? Related to above: if I POST a newsletter subscribe to Mailchimp, say, and there’s a problem adding the new user, Webflow will automatically report the “success” message if it writes to the Webflow form entries database. But if it doesn’t add the user, it’s failed… how do I capture that?

  3. Related again: if I prevent.default on the submit handler to perform some AJAX, can I do something with that on the form before submitting?

Specific Question

I’m integrating Stripe donations into my Webflow site using a Webflow form. It’s fairly straightforward to use the Webflow Embed element to include a Stripe Elements card, which is used to generate the token via AJAX, which is appended and sent when the form is submitted. But if for whatever reason the charge doesn’t go through – bad credit card, etc. – I can’t simply show the default Webflow success message.

And, actually, one more question: can I submit to a different page? Like one thing would work is if I POST to another URL, do the processing, and then use the server side logic to “return” the user to a /success or /error page on the site. I don’t need to be too specific with the error messaging, but I don’t see a way at the moment.

Any thoughts or guidance would be most welcome! I use Webflow for basically everything these days, and with Zapier I can do literally everything I want. But I’m puzzled trying to suss out a recurring billing workflow with Stripe, which requires the server side logic to return success/failure data (I should point out that the server side piece works fine, I’m just having trouble with the Webflow forms integration.)

Thank you so much!!


#2

Anybody? Bueller?

crickets

:cricket::cricket::cricket::cricket::cricket:


#3

Yes, with custom code.

How are you doing this? Directly via the action form field, or through Zapier? If directly, Webflow should not be capturing the form data. Again, custom code should be possible.

I don’t see any issue with that. Custom code can do whatever you want with the page/form/etc.

I don’t think there is a proper way of supporting Stripe, as you’ll need server-side code to handle the callback.

The server-side code will require the ability to forward the request, if you don’t use client-side ajax to submit the form and redirect.