//Edit host with your Marketo instance info
//Add an onSuccess handler
//get the form's jQuery element and hide it
document.getElementById('confirmform').style.visibility = 'visible';
//return false to prevent the submission handler from taking the lead to the follow up url.
//Edit thank you message text.
<div id="confirmform" style="visibility:hidden;"><p><strong>Thank you. Check your email for details on your request.</strong></p></div>
You will want to edit the host name and thank you message in the code sample. The first should reference your Marketo instance (e.g. “//app-sj06.marketo.com/js/forms2/js/forms2.js”) and the second should contain the thank you text that you want to display once the form is completed.
The text will display on the landing page in the exact position where you place the HTML element, so be sure you edit that in the property sheet. You should also make sure the layer of your HTML element is smaller than the layer for your form. By default, both will be put at Layer 15, so you will be safe if you make your HTML element Layer 14. If you don’t do this, you won’t be able to type in any form field boxes that overlap with the thank you message.
For more information about Marketo Forms API, please check out the developer documentation.