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

  • 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.

  • 23/07/2020
    How to Add an Opt-in Message & Privacy Policy Message to Pardot Forms

    GDPR and CASL compliance are just a few reasons to add an explicit opt-in message or a privacy policy to your Pardot forms. In this post, I’ll show you how to add a custom opt-in message to your form and a privacy consent message above the form submit button.

  • 23/06/2020
    How to Use Pardot Form Handlers

    Pardot form handlers allow you to use your own forms to post your data to Pardot. A Form handler is a great alternative to use instead of Pardot iFrame forms. They allow you to fully customize the look of your form and submit data to more than 1 database. In this tutorial, you will learn how to create a form handler from scratch.

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