How do I redirect the customer to a new page after submitting the contact form?

donna_stackhous
New Member
2 0 0

Currently, when the customer complete the contact form successfully, a success message appears on top of the form. I'd like to have the customer taken to an entirely new page instead (I think leaving the form in place is too confusing). I'm guessing I need to place some code in the template, but I'm not sure what. Can someone point me to a resources that would help?

0 Likes
Vineet_Kumar1
Shopify Partner
7 0 1

Hi donna stackhouse,

 Please refer to this link https://gist.github.com/carolineschnapp/3ae6ac982119fe248e6a and add this code in your page.contact.liquid which you can find when you edit the theme files.

Hope you get the solution.

 

Thanks,

Vineet Kumar

 

 

jack_roland
New Member
3 0 0

Which part in the code is the specific reference to the form? I'd like to do this, but only for the newsletter - so i'm trying to figure out how to single it out so its just that newsletter form

0 Likes
Forever-Curls
Tourist
13 0 0

Hey, I am doing this as well with a different form I have set up.  Do I place this within the form like this?

{% form 'contact', id: formId %} 
{% if form.posted_successfully? %}
<script>
window.location = "/pages/thank-you-for-contacting-us";
</script>
{% endif %}
{% endform %}
 
Or can I paste it at the bottom of the liquid file?
0 Likes