Thank you message on button submit

Anonymous
Not applicable

Thank you message on button submit

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

8 REPLIES 8
SanfordWhiteman
Level 10 - Community Moderator

Re: Thank you message on button submit

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.

Anonymous
Not applicable

Re: Thank you message on button submit

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;
  });
});

Anonymous
Not applicable

Re: Thank you message on button submit

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

SanfordWhiteman
Level 10 - Community Moderator

Re: Thank you message on button submit

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.

SanfordWhiteman
Level 10 - Community Moderator

Re: Thank you message on button submit

And the URL of your page w/form, so I can look at the error console + form descriptor?

Anonymous
Not applicable

Re: Thank you message on button submit

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?

Anonymous
Not applicable

Re: Thank you message on button submit

SanfordWhiteman
Level 10 - Community Moderator

Re: Thank you message on button submit

No active onSuccess code in that page. One block is commented out <!-- --> the other one is in a DIV (not a SCRIPT).