Hi All,
I have two questions, any help will be appreciated.
Ques1. I am trying to display a thank you confirmation message in a lightbox upon form button submit. I checked some of the support answers with codes on them but cannot get the pop up message.
Ques2. When I enable the form prefil there is a funny code YPE html> that popus on the landing page. I have checked the template but can't find that code anywhere. When I inspect element on the landing page, I do see it in the body ID but can not find it anywhere in the marketo template. has anyone experienced this?
Thanks,
Addy
A1. Please post a URL to your form with the attempted code. That's always necessary to troubleshoot.
A2. That looks like part of the string <!DOCTYPE html> which would be the very first line in your template.
I have used this document, http://blog.teknkl.com/same-page-thank-you-text-with-marketo-forms-about-the-aliid/ added the below code in the landing page containing the form and in the form settings added the Advanced thank you message with URL#thankyou message.
But on form submit it takes me to my home page which is the default page for a 404.
MktoForms2.whenReady(function(form){
form.onSuccess(function(vals, thankYouURL) {
var formEl = form.getFormElem()[0],
thankYouLoc = document.createElement('A'),
thankYouContainer = formEl.querySelector('#thankYouContent') || document.createElement('DIV'),
thankYouHTML;
thankYouHTML = decodeURIComponent((thankYouLoc.href = thankYouURL, thankYouLoc).hash.substring(1));
formEl.innerHTML = (thankYouContainer.innerHTML = thankYouHTML, thankYouContainer).outerHTML;
return false;
});
});
A2: <!DOCTYPE html> in the template is complete and is on the top this hye html still shows, and it is nowhere in the template
Hmm... make sure there aren't any invisible chars before the directive. Note as long as your page is having this problem then form features may not work, anyway.
And the URL of your page w/form, so I can look at the error console + form descriptor?
Hi San,
I've added the JS code as specified in your document and added the thank you message as an external URL but still cant get the thank you pop up to work am I doing something wrong?
Sorry URL of page is https://pages.nlc.com.au/LP-Unsubscribe-Confirm.html
No active onSuccess code in that page. One block is commented out <!-- --> the other one is in a DIV (not a SCRIPT).