Skip to main content
June 15, 2015
Question

How do you add a "Thank You" message upon form completion within a lightbox?

  • June 15, 2015
  • 1 reply
  • 3691 views

Hi!

I'm looking for assistance with adding a "Thank You" message upon a form's completion within a lightbox. I do not care to send the user to a separate thank you page upon form completion. Any ideas? I currently have the following:

<!-- LightBox2 -->

<a href="javascript:;" id="lightbox-link2"><img src="info.shavlik.com/rs/635-QZI-186/images/Contact-Us-Tile.gif"></a>

          <script src="//app-sji.marketo.com/js/forms2/js/forms2.js"></script>

          <form id="mktoForm_5504"> </form>

          <script>

            var btn = document.getElementById("lightbox-link2");

            btn.onclick = function(){MktoForms2.loadForm("//app-sji.marketo.com", "635-QZI-186", 5504, function (form){MktoForms2.lightbox(form).show();

              });

            };

          </script>

<!-- End LightBox2 -->

Thank you!

-kate (total js noob)

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
June 16, 2015

You want to add a Forms 2.0 onSuccess listener (this isn't specific to lightboxed/unlightboxed).

For example: MktoForms2 :: Thank You HTML​.

June 16, 2015

You might find this helpful as it has an example of a form onSuccess handler to show a thank you message: Show Thank You Message Without a Follow-Up Landing Page