Advanced Marketo Form Techniques Part 2


Customize your Marketo forms even more by using these 3 advanced Marketo form techniques. Learn how to show a thank you message after a form submission, how to limit word count on text fields and how to block free email addresses from form submissions.

This is part 2 of the advanced Marketo form techniques series. View part 1.

Show a thank you message after form submission

This snippet will show a thank you message after a successful form submission, instead of redirecting to a thank you page.

Add this piece of javascript code to your page:

Add this HTML code where you want the thank you message to display on the page:

Limit word count for a textarea & display the # of words left

Limit the number of words a user can input in a text field or textarea with this script.


Add this HTML to the label in your form.


Add this piece of javascript to your landing page. Change #comments to the name of your field and update 250 to the number of words you want to limit the field to.

Block free email addresses from filling out a form

Block @gmail,,,, and email addresses from filing out a form and require a business email address by adding this script to your landing page.

Source: Marketo Developer Blog


Email me, send me a tweet @jennamolby, or leave a comment

Related Posts

  • 15/10/2020
    How to Use Flex Fields in Pardot

    Flex fields are custom fields that can be used over and over again to limit the number of one-time-only fields within Pardot and Salesforce. They contain data that is required temporarily to execute a specific event or campaign. Once the data is no longer needed, the fields can be reset to blank using an Engagement Program or Automation Rule

  • 04/10/2020
    How To Embed a Pardot Form on Your Website The Right Way

    Pardot offers 2 methods for embedding forms on your website; embedding using an iframe, and form handlers. While the embedded iFrame forms allow marketers to have control over updating and configuring the forms, using an iFrame isn’t always ideal for website usability. In this tutorial, I will show you how to take advantage of the Pardot iFrame forms and make it look great embedded on your website.

  • 23/09/2020
    7 Ways Pardot Users Can Use Chrome Developer Tools For Troubleshooting & Testing

    Chrome Developer Tools is widely used by developers to help edit pages on-the-fly and diagnose issues. Pardot users can use DevTools to troubleshoot and test landing pages and forms. In this post, I’ll show you 7 ways you can use DevTools, including how to identify errors on a landing page, how to customize the CSS of a form and how to view hidden form field values.

7 comment(s)
  • Hanna

    06/11/2018 at 10:34 pm

    Hi Jenna, thanks for this. For "Add this piece of javascript code to your page:" - where exactly do I add? The landing page? or the Form's custom CSS? If it's the landing page, do I insert the or Rich Text element to the page? If you can add screenshot of how and where you add to this page, that would be great for people with no coding background :)

    • Jenna Molby
      to Hanna

      07/11/2018 at 9:50 am

      Hi Hanna, I recommend placing it within your landing page template right before the closing </body> tag. Cheers, Jenna

  • Nata

    26/08/2017 at 3:47 pm

    Hi Jenna, Do you have any examples on how to include multiple forms on one page

  • Peter

    15/08/2017 at 9:03 am

    Hi Jenna, thank you for this (and other) excellent Marketo posts. Question: in the 'Show a thank you message after form submission' snippet, does the form ID have to be in that code?

    • Jenna Molby
      to Peter

      15/08/2017 at 9:40 am

      Hi Peter, No the form ID doesn't have to be in that code if you have it on a Marketo landing page. If you have it on a non-Marketo landing page you should include the form ID or if you have more than one form on a page. Cheers, Jenna

  • Evan

    08/08/2017 at 2:20 pm

    I know this article is old (still highly useful though), but I am having trouble using the thank you message code in a Marketo template. I think it's because the template I'm creating allows a form to be picked and changed in the guided landing page editor, instead of using the form's embed code in the template. I get errors saying that MktoForms2 isn't defined. Any tips?

    • Jenna Molby
      to Evan

      08/08/2017 at 4:50 pm

      Hi Evan, It still should work if you're using the guided landing page editor. Send the link to your landing page to [email protected] and I can help you troubleshoot.

Leave A Comment

Your email address will not be published. Required fields are marked *

About Me

Welcome to my blog, where I share, tips, tricks, thoughts and solutions that I learn in my daily life as a Marketing Operations leader.

Most Commented
Popular Posts