Callback function for Form on Marketo Landing Page | Community
Skip to main content
September 3, 2014
Solved

Callback function for Form on Marketo Landing Page

  • September 3, 2014
  • 5 replies
  • 2148 views
I have a technical question:

We are trying to apply some additional functionality and styles to a form on a marketo landing page. The only way for us to go about doing this at the moment is to use javasript.

The problem with using javascript is that we have to wait until the form is loaded (marketo's javascript) before we can start executing ours.

Does anybody know if a callback function on a form is possible? Right now we are using a setTimeout, which is not ideal.

Thanks,
Erik
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
Yes there is. You can find tons of info here: http://developers.marketo.com/documentation/websites/forms-2-0/

Look specifically for the method ".whenReady(callback)"

You can see the code in use on this page: 
http://go.servicetrade.com/VerizonEventAugust2014.html. I use the callback to apply Bootstrap styles.

5 replies

Accepted solution
September 3, 2014
Yes there is. You can find tons of info here: http://developers.marketo.com/documentation/websites/forms-2-0/

Look specifically for the method ".whenReady(callback)"

You can see the code in use on this page: 
http://go.servicetrade.com/VerizonEventAugust2014.html. I use the callback to apply Bootstrap styles.
September 3, 2014
This should be possible with the whenReady or onFormRender methods. There is more info about these methods on the dev docs:

http://developers.marketo.com/documentation/websites/forms-2-0/

September 3, 2014
@Jason, I like your example!
September 3, 2014
Thanks Jason! Your solution did the trick!
September 3, 2014
No problem guys... love to help with JS stuff as it's what I'm trying my best to master :)