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

  • 05/03/2020
    How to Create a Better Date Picker Within Pardot Forms

    Want to be able to restrict the date range of a date picker within your Pardot forms? The default date picker with Pardot does not provide this option, but with a couple of lines of JavaScript, you can enhance the functionality of the date picker. In this tutorial, I’ll show you how to use the jQuery UI date picker within your Pardot form.

  • 09/10/2019
    Creative Ways to Spice Up Your Pardot Forms: Part 2

    The 2nd part of the form customization series is finally here! In part 1, I showed you how to implement the popular floating label technique and how to create searchable, user-friendly dropdowns. In this post, I will show you how to create a conversational, paragraph-style form and how to create a form on a single line.

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