I have a Marketo form embedded on our website, I'm wondering if it's possible to dynamically fill an input field with text using jQuery? The web page that contains the embedded form is on a non Marketo hosted web page.
Here is the jQuery that I'm currently attempting to use:
var text = "Hello World";
$('#FirstName').val(text);
So far, I haven't had any luck getting this to work. It works on non Marketo forms such as Gravity Forms.
Thanks in advance for any help!
-Brandon
Solved! Go to Solution.
Marketo Forms has its own API which should always be used (check the docs on developer.marketo.com).
You want
MktoForms2.whenReady(function(form){
form.setValues({FirstName:'Hello World'});
});
Hi Sanford,
Where should I look in the docs for this type of thing? I've gone through the API but couldn't seem to find anything to fill this need.
Thanks!
The Forms 2.0 API, not any of the other APIs. It's one of the choices in the left nav on the developer site.
Thank you so much!!!