Redirect to external website after embed form submission?

Hey everyone, I’m using a third party form on my website to track signups and want to redirect to a custom thank you page. The form is embedded using HTML that contains the redirect URL within. The thank you page is not hosted on my domain nor is it on the same domain as the third party form website.

Step 1 Form Landing Page
Step 2 Submit Form
Step 3 Thank you Email sent
Step 4 Redirect to custom thank you page

The breakdown is between steps three and four.

The redirect fires, but wix prevents it from accessing the third party website and it fails reading:

Refused to display URL “in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’”

I thought the solution would be to disable the sandbox attribute within the iframe and add an event code to the element that initiated the redirect when upon form submission.

I tried to disable the sandbox attribute by adding the code to the HTML in the embed section but it doesn’t work – I suspect because there are no iframe tags in that part. After using developer tools I was able to locate them on the page, but they are hidden and I am unsure if Wix will allow you to even access them.

example: sandbox=" allow-top-navigation allow-same-origin allow-forms allow-popups allow-scripts allow-pointer-lock"

I also tried to manually ad the redirect using an event code to the page element via Corvid in the hopes that it would work.

I am self taught on this stuff and assume this is somewhat of a common problem?

Help?

Why would you need a completely separate Thank You page that is not connected to either your own Wix website or the third party app that you are trying to integrate with Wix itself?

Why can’t you just make up the Thank You page as a separate page on tour Wix website and if it needs to contain certain variables, then make it a dynamic page so that it can be customised for each users form submit etc.

You can already use Wix Automations to send emails automatically.
https://support.wix.com/en/article/sending-automated-response-emails-to-contacts

Also, you can send triggered emails to contacts, members or on form submission through Wix Code or third party methods for example.
https://support.wix.com/en/article/corvid-tutorial-sending-a-triggered-email-to-contacts
https://support.wix.com/en/article/corvid-tutorial-sending-a-triggered-email-to-members
https://support.wix.com/en/article/corvid-tutorial-sending-an-email-on-form-submission

Plus, you can already pass data from a page to a html iframe or from a html iframe to a page by using on and post message etc.
https://support.wix.com/en/article/corvid-working-with-the-html-element

Also, note that you can use tracking tools in Wix already too with just a simple add of code to your website.
https://support.wix.com/en/article/about-tracking-tools-analytics

Finally, do you need to use html code on your website or can you call the third party app through it’s own API or by exposing your website through HTTP Functions.
https://support.wix.com/en/article/corvid-accessing-third-party-services-with-the-fetch-api
https://support.wix.com/en/article/corvid-calling-server-side-code-from-the-front-end-with-web-modules
https://support.wix.com/en/article/corvid-exposing-a-site-api-with-http-functions

Using Wix Fetch and the third party’s own API, if it is possible, is a much better and more secure way of working than with html code through an html iframe on your page.

Yes it will involve more work and be harder to implement for you, however it would be a better option if you can do it that way.

Have a read of the X-Frame options too as it isn’t Wix can do anything about unless the third party that you have the form html from allows it.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
https://www.wix.com/corvid/forum/community-discussion/x-frame-options-to-sameorigin

Hi,
I believe I’m having the same problem with my Wix-hosted site. I have an embedded form in a HTML iFrame element pointing to a 3rd party back-end. Last year all worked as expected, submitting the form redirected the user to a thank you page hosted on Wix (so it’s not even external). Now the redirection is broken - pressing the submit button will post data, but redirection will silently fail (nothing happens). Google points me to the same root cause - the iFrame is now sand-boxed without allow-top-navigation attribute set and that probably prevents the redirection. Can you please advise. It’s a show stopper for me :frowning:

Thank you, Michal

If you are having issues with html from a third party provider then you will need to go back to the third parties own support to get help with your issue.

https://support.wix.com/en/article/using-iframes-to-display-visible-content-on-your-site
Wix cannot provide support for external codes that were not created or tested with Wix.
If you are experiencing an issue with your code snippet, please contact the provider directly.

Otherwise, do as suggested in the previous reply, if you have access to the third parties backend then look at using their API instead and code your site for that.