Hello
This might be a very simple question. I am basically trying to create form that is being embedded on a web page called 'get-started' but the form should automatically redirect to a relative 'thank you' page that is one level down in the hierarchy 'get-started/thank-you' . How do I setup a redirect to a relative page on the website that this form is located on?
MktoForms2.whenReady(function(form){
form.onSuccess(function(vals,tyURL){
var loc = document.createElement('A');
loc.href = tyURL;
loc.pathname = [loc.pathname,"thank-you"].join("/");
document.location.href = loc.pathname + loc.search + loc.hash;
return false;
});
});
Thank you Sanford. Where does this code go? or where does this code need to be added?
Currently my ember code is
<script src="//app-ab22.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_4"></form>
<script>MktoForms2.loadForm("//app-ab22.marketo.com", "876-MVP-978", 4);</script>
Right after the embed code, in a <script>.
I added the code.
However The submit button is going to https://thank-you, instead of /get-started/thank-you.
The Marketo form is located at: https://ibs.schwab.acsitefactory.com/get-started.
The thank-you page is located at: https://ibs.schwab.acsitefactory.com/get-started/thank-you,
so the link needs to be t
The Marketo form is located at: https://ibs.schwab.acsitefactory.com/get-started.
The thank-you page is located at: https://ibs.schwab.acsitefactory.com/get-started/thank-you,
so the link needs to be the relative link of /get-started/thank-you.
he relative link of /get-started/thank-you.
The code expects you to still have a Thank You URL entered in the Form Editor, because you may want to add query params and hash at some point.
Then it swaps out the path of the Thank You URL for the relative path (but it keeps the query and hash -- search and hash -- of the URL).
The form does currently have a url 'https://www.schwab.com' listed in the follow up with field as an external URL. are you talking about something else?
The page is actually redirecting to https://ibs.schwab.acsitefactory.com/thank-you instead of https://ibs.schwab.acsitefactory.com/get-started/thank-you