Redirect SUBMIT button in a contact form to a Thank you page

Hi,

I am hoping one of you legends can help me with the following.

I am using Flex 3.3.0 and have a contact form on a landing page (for a competition). I would like to have the submit button redirect to a thank you page.

Is there something I can put in the Custom CSS to achieve this?

Thanks,

Peter

Hi,
I hope you are doing well.
You can do this by setting a return_to url like this:

{% form 'form_type', return_to: "your-thankyou-page-url-here" %}

I hope, It helps you.
Thanks!

  • In your Shopify store’s backend, go to Settings > Checkout.

  • Scroll down to the “Order processing” section and look for the “Additional content & scripts” field.

  • Add the following code to the “Additional content & scripts” field:

    <script> Shopify.onItemAdded = function(line_item) { window.location.href = '[https://your-thank-you-page-url.com](https://your-thank-you-page-url.com)'; }; </script>

    Replace [https://your-thank-you-page-url.com](https://your-thank-you-page-url.com) with the URL of your “Thank You” page.

  1. Save the changes.

This code will redirect the user to the “Thank You” page when a successful payment is made. Please note that this code assumes that the user is redirected to the “Cart” page after clicking the “Checkout” button, and the user is not using a third-party payment gateway. If your store uses a different payment flow, you may need to modify the code accordingly.

Thanks, Pawankmar. I just tried that, and it didn’t work, unfortunately.

Hi Harryperry, thank you for your reply but I think you have misunderstood my question. I am not after a redirection after a purchase. I am after a redirection from the submit button on a contact form.

Hi Harryperry, thank you for your reply but I think you have misunderstood my question. I am not after a redirection after a purchase. I am after a redirection from the submit button on a contact form.

Can you please share store URL and contact us page URL so that I can check this on my side. Please provide password as well if it is password protected
Thanks!

I trying to do the same exact thing - did you manage to work out what code to put in? Thanks