Creating a Form with both a thank you message and auto redirect

Aly_Mourady
Member | Platinum Partner
Member | Platinum Partner

Since there's no way to do this in just one step, the workaround for this issue is quite simple. Basically, what you're going to do is redirect to a landing page where you'll input a custom module made in the design manager including the code below.(in this example i redirected to the google homepage) What this will do is give you 2 seconds of delay before redirecting you onto the next link.

<div id="thank-you-container">
  {{ thank_you_message }}
  <h2> Thank you!</h2>
<p>We'll take you to the next step in just a moment...</p>

</div>

<script>
  console.log("Redirecting to: https:\\google.com");
  setTimeout(function() {
    window.location.href = "https:\\google.com";
  }, 2000);
</script>

 

Best Regards,

Aly Mourady

 

1 Reply 1
BérangèreL
Community Manager
Community Manager

Hi @Aly_Mourady, I hope that you are well!

Oh wow, that is so helpful, thank you so much for sharing this workaround with the HubSpot Community!

I am sure that this will help many Community Members!

Have a lovely day @Aly_Mourady and looking forward to seeing you around the Community! 🤗
Bérangère





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes