Looking for some creative ways to spice up your Pardot forms? In this post, I will show you how to implement the popular floating label technique in three easy steps. I will also show you how to turn your long drop down menus into user-friendly, searchable dropdowns.
This is part 1 of the 3 part series. Check out part 2 here.
1. Floating labels
You have probably seen this technique before. The label appears as placeholder text and when you click on the field the text moves out of the way and allows you to type. This technique can be applied to your Pardot forms in three steps.
Here’s an example of what it looks like. Click on the field to see the effect.
See the Pen Pardot form floated labels (Styled) by Jenna Molby (@jennamolby) on CodePen.
Adding this effect to your Pardot forms
Step 1: Edit your layout template
In order for this to work the labels within your forms must be placed below the fields. By default, the labels are above the form fields. To modify this, you will need to edit the layout template, click on the form tab and replace everything within the editor with the code below.
Step 2: Add the CSS
Add the CSS below to your layout template. This will create the effect of the floating labels for all form field other than radio buttons and checkboxes.
Step 3: Add the Javascript
In addition to the CSS, this method uses some Javascript. Place the code below within your layout template as well.
The result
Here’s what the floating labels look like after implementing all the code within the layout template.
See the Pen Pardot form floated labels (Simple) by Jenna Molby (@jennamolby) on CodePen.
2. Searchable dropdowns
I came across this technique when I was registering for a webinar recently. 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 Pardot forms. It turns out, you can and not only is it super easy to implement, but it also makes long drop-down in your Pardot forms more user-friendly.
Demo
Here is what a searchable drop down looks like in action.
See the Pen Chosen.js Demo (Single Select) with Pardot Forms by Jenna Molby (@jennamolby) on CodePen.
Adding this effect to your Pardot forms
Navigate to your form and click edit form. Go to step 3: Look and Feel, click on the below form tab, click on the HTML icon and paste this code:
Update country with the name of your drop down field. Optionally, you can update the no_results_text to what ever you want to display when the no results are found for the searched term.
Questions?
Send me a tweet @jennamolby, leave a comment below, or book a Peer Chat.
52 Comments
Thanks again for this wonderful tip Jenna.
Quick question though. All my fields seems to be working except the last one. The label is hovering without any data in. Any idea what may be the reason may be? The last 2 fields are picklists and are both required.
https://drive.google.com/file/d/1cX8NwOGJ4LAKZvm47BM5D0tbxpZylmuB/view
Thanks again.
Hi Jaco, You’re welcome! This is the intended behaviour for picklists since they don’t allow placeholder text.
Hi Jenna, this is super helpful thank you for sharing! I do have a question… how do you make your submit button full width and centered?
Hi Tim, You’re welcome! Here’s how you center the submit button
#pardot-form p.submit {
margin-left:0;
text-align:center;
}
and here’s how you make it full width
#pardot-form p.submit input {
width:100%;
}
Hi there! Thanks for the great content – more than one of your articles has been extremely helpful in setting up Pardot for the first time. For this guide, I was able to get the floating labels, but my labels don’t move up like yours when the user types into the field. They just stay there, over the typed text. Any idea what’s going on? I checked for conflicting css and am not coming across any, but I may be looking in the wrong place. Thanks!
Hello! So happy you find my content helpful :). If the labels aren’t moving there might be an issue with the Javascript rather than the CSS. Send me an email with the link to your form and I can take a look.
Hi Jenna, I implemented the floating labels from this article.
I tried to combine it with the 2 column form code from here: https://jennamolby.com/the-best-way-to-create-a-2-column-pardot-form/ but that did not mix well with the labels as they did not react to the columns.
Do you have a fix for this?
Hi Will, I haven’t tried combining them myself, but it still should work. Send me the link to your page and I can take a look for you.
I’m getting an issue trying to combine them too.
The textarea field seems to break everything, if I remove it everything is fine.
any help would be greatly appreciated.
Steve
Hi Steve, Send me the link to your form and I can take a look.
Hi Jenna,
I have a question, for the searchable dropdown field, is it only applicable for State/Country, or it can be used anywhere?
Thanks
Mandy
Hi Mandy, It can be used for any dropdown. All you have to do is modify the Javascript to include the proper field name. Cheers, Jenna