Jump to content

How to make a Squarespace form submit an HTTP POST request to an external URL

Recommended Posts

Guest TopDoris

Site URL: https://lolamack.com.au

Although the Squarespace form allows integration with MailChimp, Sheets and Zapier, I'm hoping there's a way to configure a form submission to POST an HTTP request to an API with all the form fields included in the message. Does anyone know if this is possible? I know Zapier supports webhooks, so i could connect the form to Zapier and then get it to send the HTTP request, but Squarespace is the only app I use that doesn't support HTTP requests natively and so I don't want to pay for Zapier just for one integration. Maybe pushing my luck here, but ideally the solution would avoid any script. 

Any guidance appreciated!

Link to comment
  • Replies 6
  • Views 3.8k
  • Created
  • Last Reply

Top Posters In This Topic

On 5/14/2021 at 11:11 AM, TopDoris said:

Site URL: https://lolamack.com.au

Although the Squarespace form allows integration with MailChimp, Sheets and Zapier, I'm hoping there's a way to configure a form submission to POST an HTTP request to an API with all the form fields included in the message. Does anyone know if this is possible? I know Zapier supports webhooks, so i could connect the form to Zapier and then get it to send the HTTP request, but Squarespace is the only app I use that doesn't support HTTP requests natively and so I don't want to pay for Zapier just for one integration. Maybe pushing my luck here, but ideally the solution would avoid any script. 

Any guidance appreciated!

Zapier is the only low code solution for the Squarespace Form, you can register custom form submission handler using javascript and submit the data to your url, but then you have to handling stuff like validation and spam filter by yourself. What kind of service you are going to submit the data to?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
Guest TopDoris

Thanks for the response. The data will be submitted to an Azure Logic App HTTP endpoint. Could the script be triggered in the post-submit HTML so that the form will continue to handle validation and spam filtering? 

Link to comment
1 minute ago, TopDoris said:

Thanks for the response. The data will be submitted to an Azure Logic App HTTP endpoint. Could the script be triggered in the post-submit HTML so that the form will continue to handle validation and spam filtering? 

Yes, you can serialize the form content using javascript on submit event, but the validation will rely on frontend side only so you may have to set up server side validation for the incoming submission as well

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
Guest TopDoris

Ok great. Once the submit is sending data to the Azure endpoint I can take it from there, but I have no knowledge of javascript. Any thought's on the best place to find people who'd be interested in taking on small coding tasks like this one for a reasonable fee?

Link to comment
35 minutes ago, TopDoris said:

Ok great. Once the submit is sending data to the Azure endpoint I can take it from there, but I have no knowledge of javascript. Any thought's on the best place to find people who'd be interested in taking on small coding tasks like this one for a reasonable fee?

I usually meet project like this on upwork or freelancer.com

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
  • 2 years later...

If somebody wants to run some JavaScript after form submission for example for conversion tracking you can check this video: 

Here are the source codes: https://github.com/sorcamarian/squarespace-tricks/tree/main/Forms

You can track form changes using regular DOM events and have form data stored.
After the above code for form submission is executed you can get the latest data stored and do HTTP requests with it.

Edited by sorca_marian
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.