How to redirect AFTER a contact form success message

Hello! I’ve done some digging in the forums and understand I can set a redirect page from the form block settings for my contact form, however I still want visitors to be directed to the success message and then after a delay either be sent back to the previous page, or to my homepage. Is this possible? Right now, the success message loads and the page just stays there so visitors would have to self navigate out with the nav bar options.


Here is my site Read-Only: https://preview.webflow.com/preview/abby-mueller-designs?utm_medium=preview_link&utm_source=designer&utm_content=abby-mueller-designs&preview=d8f155163df87cc8d498300da1bc136b&pageId=607a420e95a0ee0c0124d68b&workflow=preview

Hello Abby,

You can try using custom JS Code to do so.

Firstly you need to import JQuery to your project.

Second, you will have to add this custom code :
The code executes a command after 5 seconds when your element becomes visible. Just replace “#element” with “#”+“your id name” and the stackoverflow link with the link to your website.

If you would like it to execute later , just change the 5000 to 12000.

if($('#element').is(':visible'))
{
    setTimeout(function() { window.location.href = "http://stackoverflow.com"; }, 5000);
}

Hope this helps

1 Like