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

  • 21/09/2017
    3 Free Pardot Landing Page Templates for Asset Downloads

    Create beautiful, responsive landing pages in Pardot by using one of these 3 free Pardot layout templates. These landing page templates are designed specifically for gated assets such as white papers and eBooks, but they will work well with any landing page that contains a form.

  • 08/09/2017
    How to Create Responsive Marketo Forms

    Marketo forms, by default, have set widths for many elements including all the form fields, labels and even the form itself. If you’re embedding your form in a responsive landing page, you might want to make the form fully responsive as well. With a bit of CSS, you can make your one-column and two-column Marketo forms look great on every device.

  • 05/07/2017
    Make Your Marketo Forms More User-Friendly With This Tip

    I was registering for a webinar this week and when I went to select my Country from the drop-down, I was greeted with a search feature for the drop-down. I immediately started Googling what JavaScript plugin they were using to see if I could use it on Marketo forms. It turns out, you can and not only is it super easy to implement, but it also makes long drop-down in your Marketo forms more user-friendly. I’ll walk you through how I did this in 4 easy steps.

5 comment(s)
  • 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 sales and marketing professional.


Most Commented
Popular Posts