Thank you message on button submit | Community
Skip to main content
March 21, 2017
Question

Thank you message on button submit

  • March 21, 2017
  • 1 reply
  • 3360 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
Level 10
March 21, 2017

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.

March 21, 2017

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

March 21, 2017

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