How to Add Placeholder Text Within Pardot Forms

In:

There’s currently no feature for Pardot forms that allow you to use placeholder text instead of the label text. So, in this tutorial, I will show you how to add a bit of JavaScript to your Pardot forms to use the field labels as placeholders.

Step 1: Add the JavaScript

Navigate to Marketing > Forms > Layout Templates and select the layout you want to add the placeholder text to. Paste this Javascript at the bottom of the form tab and save.

Step 2: Add the CSS

If you want to use placeholder text instead of the form field labels, you will need to add some CSS that will hide the labels on the form.

Navigate to Marketing > Forms > Layout Templates and select the layout you added the JavaScript to. Paste this CSS at the top of the form tab and save.



Questions?

Send them to me via email, send me a tweet @jennamolby, or leave a comment

Related Posts

  • 24/05/2017
    8 Tips for Creating Marketo 2.0 Email Templates From Scratch

    Over the past couple of months, I have been creating email templates using the new(ish) email template syntax in Marketo and I’ve learned a couple tricks along the way. To save you from some headaches, here are 8 tips that I’ve learned from creating Marketo 2.0 email templates from scratch.






  • 30/01/2017
    5 Noteworthy Sales Cloud Features in the Salesforce Spring ’17 Release

    The Salesforce Spring ’17 release is being rolled out to all ORGs later this week, so it’s time to do a recap of my favorite features coming up in the new release. This release includes some of the most-requested Lightning Experience usability enhancements. If you’re like me and have been hesitant to switch your Sales Cloud users over to the Lightning Experience, this release might change your mind.






  • 04/01/2017
    Beautiful Marketo Forms: Styling Checkboxes and Radio Buttons

    Your Marketo forms don’t have to be boring. With a little extra CSS you can create beautiful Marketo forms with customized checkboxes and radio buttons. In this tutorial, I’ll show you how you can style checkboxes and radio buttons within Marketo forms with minimal coding.






6 comment(s)
  • Katy

    17/04/2017 at 12:29 pm
    Reply

    Jenna, I thought I'd add that the jquery link needs to be added and this modified version works best for me: var labels = document.querySelectorAll("p.pd-text label, p.pd-select label, p.pd-textarea label"); var i = labels.length; while (i--) { var label = labels.item(i); var text = label.textContent; label.parentNode.classList.contains("required") && (text += " *"); var nextElement = label.nextElementSibling; if(nextElement){ if (nextElement.tagName == 'SELECT') { nextElement.options[0].text = text; } else { nextElement.setAttribute("placeholder", text); } label.parentNode.removeChild(label); } } var elements = document.querySelectorAll('.errors, .no-label'); Array.prototype.forEach.call(elements, function(el, i) { el.parentNode.removeChild(el); });

  • Anna

    15/02/2017 at 5:55 am
    Reply

    Hi Jenna, Thank you for this! I tried it but couldn't get it to work on drop down menus. Do I need to add anything extra?

    • Jenna Molby
      to Anna

      15/02/2017 at 11:37 am
      Reply

      Hi Anna, Placeholders don't work for dropdowns. Instead, you need to create a default value for the first value of the dropdown.

    • Jean M
      to Jenna Molby

      16/02/2017 at 7:40 am
      Reply

      Hi Jenna, how would you create a default value for the dropdown?

    • Jenna Molby
      to Jean M

      16/02/2017 at 9:27 am
      Reply

      Hi Jean, This is a bit more complicated since I don't think there's a way to add a default option in Pardot forms. Feel free to email me at contact@jennamolby.com with a link to your form and I can show you how it's done using some Javascript. Thanks!

    • Terry Rourke
      to Jenna Molby

      11/05/2017 at 12:46 pm
      Reply

      I was able to add a label using the first "blank" value. Edit the form field, on "Values" tab click on the "A" next to the top blank value to show the label, place the field name here and save. Now the blank value at the top will have the value of the field name and be shown.

Leave A Comment

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

About Me

I’m a Marketing Operations Manager and Marketo Certified Expert who is passionate about front-end development, web design, data, and email marketing. LEARN MORE

Categories
Most Commented
Popular Posts