Having a button and the embedded lightbox appear when clicked - Forms 2.0 | Community
Skip to main content
January 28, 2014
Solved

Having a button and the embedded lightbox appear when clicked - Forms 2.0

  • January 28, 2014
  • 24 replies
  • 7010 views

Hello -

I have a page that I am building (http://www.bkd.com/stay-connected/offices/ar/arkansas-test.htm). I am wanting to add a button and when the button is clicked on the lightbox form shows up. Right now it just appears when the page is refreshed or loaded. My fear is some people will not want to subscribe right away but maybe after they read the page. 

Does anyone know how to accomplish this using the new Forms 2.0?

Ultimately it would be ideal to  have it pop up when the page is loaded and allow them to have the option to bring it back up using a button.

Thank you for your help.
-Marcy-

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by
1. The image needs to be wrapped in a link:

<a href="#" id="lightbox-link"><img src="/images/stay-connected/subscribe-button.png"></a>

2. You were just supposed to eliminate that one line from the Marketo embed code; you erased the whole thing. Paste what they give you in Marketo, just remove the line I indicated.

24 replies

January 28, 2015
Thanks Bao, for the sample code. Our form resides as an embed in a non Marketo page with no jquery so I've had to use yours.

Additionally, because our button is somewhere in a page with lots of page scrolls, I replaced the a href="#" with a href="#xyz" and simply created <a name="xyz"></a> near that button.
May 6, 2015
Wa-hoo!!  I got it to work - thank you!
June 12, 2015

Having gotten this to work, I tried enabling the Social Form Fill. After clicking one of the three social buttons to do the autofill, a popup comes up that seems to connect to do the autofill but fails. You end up with the popup social fill being redirected to the home page and the lightbox form is not filled out. Is anyone else getting this issue?

September 17, 2015

Patrick - were you able to resolve your issue. We are experiencing the same thing.

Andy_Penkalski
Level 2
April 14, 2016

Not sure if this thread is still getting much traffic, but I could really use some help getting this click-to-open function working on one of our landing pages: Advicent | Financial Planning Technology

I've attempted to apply the code to our "Free Two-Week Trial" button on our Profiles product within that page, but no tinkering within the source code has gotten it to work.

I could really use another set of eyes. Thanks

SanfordWhiteman
Level 10
April 14, 2016

What browser are you testing in?

Here's Chrome 48:

FF 37:

Andy_Penkalski
Level 2
April 14, 2016

I've been testing in chrome. That's weird that you were able to get the form to come up.

I've since been able to get this to work after bugginf a friend of mine who's better with java script and he provided the code below, which solved my issue.

<script type="text/javascript">

$(function () {$('#lightbox-profiles').click(function () { MktoForms2.loadForm("//app-sj09.marketo.com", "841-KAP-325", 1035, function (form) { MktoForms2.lightbox(form).show(); }); }); });

</script>

His explanation being that the script "just needed a doc ready function since it's jquery".