Jump to content

Code for redirect after form submission (IN NEW TAB)

Recommended Posts

  • 6 months later...
  • 3 months later...
On 10/1/2021 at 4:29 PM, creedon said:

You can use the Post-Submit Message HTML field and add the following.

<script>

  const url = 'http://www.tomsWeb.consulting/';
  
  open ( url, '', 'target=_self' );
  
  </script>

Let us know how it goes.

Thank you! It works but it opens a new window. Is it possible to just open the page in a new tab? 

Link to comment
  • 8 months later...
On 10/5/2021 at 6:26 AM, creedon said:

Here is an alternate way to do it.

<script>

  const url = 'http://www.tomsWeb.consulting/';
  
  location.href = url;
  
  </script>

Let us know how it goes.

Hi there,

Bringing up an old post here but I have tried this code and it still opens in the current tab. Any other idea how I can have a page (or preferably a live PDF file) open in a new tab?

 

Thank you!

Link to comment
14 hours ago, AndySands said:

how I can have a page (or preferably a live PDF file) open in a new tab?

 

<script>

  const url = 'http://www.tomsWeb.consulting/';
  
  open ( url, '', 'target=_blank' );
  
  </script>

Let us know how it goes.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

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.