Squarespace Form Redirect (free)

Easily add page redirects to your Squarespace Forms and Newsletter Signups. This free code snippet (plug-in) is a great way to add a nice thank you page after a user submits their information. Below you'll find out how easy it is to make this possible.

 

How-to Install Video - Form Redirect

Below you will find a detailed video that will guide you through how to install and setup this code snippet.


Quick install - Form Redirect

 

1. Create a Form or Newsletter block

Place a Form or Newsletter Block anywhere on the page you'd like.

 

2. Paste Code into the Post-Submit HTML Area

While editing your form, click on the Advanced section in the top right corner. Scroll down a little until you see the Post-Submit HTML text area, and paste the code that I provided into the text area.

 

3. Update the Redirect URL, Done

Make sure to change the redirectURL variable to the URL you'd like the form to redirect to once the form has been submitted.

ATTENTION: Make sure you're logged out of the site editor. For the form to work you can't be in edit mode on your Squarespace site.


The code

Simply copy all of the code below and paste it in the Post-Submit HTML text area of the Advanced section while editing your form.

<script type="text/javascript">
  // Your Squarespace form redirect URL
  var redirectURL = "http://www.google.com";
     
  // Fixes an issue with IE8 and lower
  if ( navigator.userAgent.match(/MSIE\s(?!9.0)/) ) {
    var referLink = document.createElement( "a" );
    referLink.href = redirectURL;
    document.body.appendChild( referLink );
    referLink.click();

  // Standard redirect for all other browsers
  } else {
    window.location.assign( redirectURL );
  }
</script>
Version 1.0 released 04/10/16

 

Need Help installing this Plug-in?

Is the code not working as intended or you're having problems installing this code snippet? Please submit a support ticket on the Code Shop Support page if you need help.