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-
Solved! Go to Solution.
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
What browser are you testing in?
Here's Chrome 48:
FF 37:
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".
AFAIK that newer code was on the page when I took my screenshots, which means there's no discrepancy.
It isn't true that Marketo Forms are dependent on document.ready. In fact, it's the opposite: they have their own event model and you shouldn't trust jQuery to know anything about them. HOWEVER... in this case, the <A> to which you're adding the click listener needs to exist before you add the listener. That might have been your problem.
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?
Patrick - were you able to resolve your issue. We are experiencing the same thing.
Hello,
Thanks to this thread, I got this working too. And thanks Lucho for that little trick - the # was driving me nuts!
My question is how do I modify the code to have mutliple links on a page (non marketo landing page). I have a page with the same event in different cities, on different dates. I want the user to click on the register button and have the form pop up for that city/date.
I've tried changing the ID like so (see bold) but it doesn't work. When i click, nothing happens.
<!-- NOVEMBER 12 EVENT -->
<a href="javascript:;" id="dec11" class="noarrow"><img src="register-purple.jpg"></a>
Kasia
Hey Dan,
I tried the steps above and it didn't work for me either. I looked at your test page, and it looks like it works though! In any case, here's what I did to get it working on a non-marketo webpage, based on info here (http://developers.marketo.com/documentation/websites/forms-2-0/). Just replace the bold parts with your info.
<a href="#" id="lightbox-link">LINK</a>
Thank you for this! Spelling it out like this was really helpful.
----------
Just replace the bold parts with your info.
<a href="#" id="lightbox-link">LINK</a>
<form id="mktoForm_XXXX"> </form>
<script>
var btn = document.getElementById("lightbox-link");
btn.onclick = function(){
MktoForms2.loadForm("//app-XX01.marketo.com", "123-ABCD-000", XXXX, function (form){
MktoForms2.lightbox(form).show();
});
};
</script>