Jump to content

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

Recommended Posts

Guest TopDoris
Posted

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!

  • Replies 6
  • Views 4.9k
  • Created
  • Last Reply

Top Posters In This Topic

Posted
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 (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

Guest TopDoris
Posted

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? 

Posted
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 (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

Guest TopDoris
Posted

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?

Posted
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 (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

  • 2 years later...
Posted (edited)

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

 👨‍🔧👨‍💻 Squarespace plugins

🙋‍♂️ Squarespace Custom Web Development & Design Services

📅 Todoist alternative | Increase your Productivity 

📹 Squarespace Tutorials for free - YouTube📹 

💯🚀 I have worked on over 300 Squarespace sites with custom code for over 9 years

🙋‍♂️ Let's connect on LinkedIn

 

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.