Looking for a way to spice up your Pardot email preferences page? Try using toggles instead of checkboxes. In this tutorial, I’ll show you how to create a preferences page that uses toggles instead of checkboxes. With a bit of HTML and some CSS, you can transform your preferences page in four easy steps.

Demo

Here’s an example of what we’ll be creating in this tutorial.

See the Pen Pardot Preferences Page With Toggles by Jenna Molby (@jennamolby) on CodePen.

Step 1: Style your preference page

This post does not cover the basics of styling your Pardot preferences page. Click here to learn how to customize your page from scratch.

Step 2: Update the preferences page template

To make the toggles work, you will need to edit the form section of your layout template. Navigate to the layout template and click on the form tab. Replace the content with this HTML.

%%form-opening-general-content%% %%form-if-thank-you%% %%form-javascript-focus%% %%form-thank-you-content%% %%form-thank-you-code%% %%form-end-if-thank-you%% %%form-if-display-form%% %%form-before-form-content%% %%form-if-error%%

Please correct the errors below:

%%form-end-if-error%%
    %%form-start-loop-fields%%
  1. %%form-if-field-label%% %%form-end-if-field-label%% %%form-field-input%% %%form-if-field-description%% %%form-field-description%% %%form-end-if-field-description%%
  2. %%form-field-if-error%%

    %%form-field-error-message%%

    %%form-field-end-if-error%% %%form-end-loop-fields%%
%%form-spam-trap-field%%

%%form-after-form-content%% %%form-end-if-display-form%% %%form-javascript-link-target-top%%

What’s changed?

  1. Instead of placing the form fields in a paragraph, the form fields are placed in an ordered list with a class named “switches”.
  2. Some jQuery is added to update the HTML markup of the preferences form.

Step 3: Upload icons into Pardot

There are two icons that will need to be uploaded in Pardot, a checkmark icon and a “x” icon. Download the images and then upload the images into the content library within Pardot.

Step 4: Add the CSS for the toggles

Add this CSS to your layout template. Update the first couple of lines to include the image paths to the icons you uploaded in step 4.


/* Update this line with the URL of your checkbox image */
.switches .pd-checkbox [type="checkbox"]:checked + label span:last-child::after {
  background-image: url(https://);
}
/* Update this line with the URL of your "X" image */
.switches .pd-checkbox span:last-child::after {
  background: url(https://);
}
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

ol {
  list-style: none;
}
label {
  cursor: pointer;
}
#pardot-form p {
  margin-left:0;
  padding-left:0;
}
/* hide the checkbox */ 
[type="checkbox"] {
  position: absolute;
  left: -9999px;
}
/* Position the checkbox label */
.switches .pd-checkbox label {
  display: flex;
  align-items: center;
  justify-content: space-between;

}
/* Style the switch */
.switches .pd-checkbox label.inline span:last-child {
  position: relative;
  width: 50px;
  height: 26px;
  border-radius: 15px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.4);
  background: #434257;
  transition: all 0.3s;
}

.switches .pd-checkbox label.inline span:last-child::before,
.switches .pd-checkbox label.inline span:last-child::after {
  content: "";
  position: absolute;
}

.switches .pd-checkbox span:last-child::before {
  left: 1px;
  top: 1px;
  width: 24px;
  height: 24px;
  background: #FFF;
  border-radius: 50%;
  z-index: 1;
  transition: transform 0.3s;
}
/* Style the "X" switch */
.switches .pd-checkbox span:last-child::after {
  top: 50%;
  right: 8px;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  background-size: 12px 12px;
}
/* Style the "ON" switch */
.switches .pd-checkbox [type="checkbox"]:checked + label span:last-child {
  background: #00d084;
}

.switches .pd-checkbox [type="checkbox"]:checked + label span:last-child::before {
  transform: translateX(24px);
}

.switches .pd-checkbox [type="checkbox"]:checked + label span:last-child::after {
  width: 14px;
  height: 14px;
  left: 8px;
  background-size: 14px 14px;
}

Now your page would look something like this, with the checkboxes turned into toggles.

Optional: Add any additional CSS

I added some additional CSS to my page to style the labels, list descriptions and options for my page. Here’s the CSS I added.


#pardot-form .no-label{
  text-align:center;
   margin-top:35px;
}
#pardot-form .no-label a {
 text-decoration:underline;
}
#pardot-form label {
  font-weight:500;
  font-size:15px;
}
.pd-email {
  margin:20px 0;
}
#pardot-form .description {
  text-align:left;
  display:block;
}
#pardot-form li.pd-checkbox {
  background-color:#FFF;
  margin-bottom:5px;
  border:solid 1px #ebebeb;
  padding:0px 20px 20px 20px;
  border-radius:5px;
  -moz-border-radius:5px;
  -webkit-border-radius:5px;
}
#pardot-form .label-wrapper {
  color:#444444;

}
#pardot-form {
  color:#737373;
}
#pardot-form .form-field {
  text-align:left;
}
#pardot-form input.text {
   border:solid 1px #ebebeb;
  padding:10px;
  border-radius:5px;
  -moz-border-radius:5px;
  -webkit-border-radius:5px;
  color:#737373;
}
#pardot-form .no-label {
  text-align:center;
}
#pardot-form .no-label a {
    color:#737373;
}

The final result

Here’s what my final page looks like.

See the Pen Pardot Preferences Page With Toggles by Jenna Molby (@jennamolby) on CodePen.

Questions?

Send me a tweet @jennamolby, leave a comment below, or book a Peer Chat.



Special thanks to Tuts+ for a great tutorial on CSS toggles. This tutorial was the inspiration for building this within Pardot.

Author

I'm a Freelance Marketing Operations Consultant With 15 years of experience in Marketing Operations, I’ve worked with a wide range of tools including Salesforce, Marketing Cloud Account Engagement (Pardot), Marketo, and many other sales and marketing platforms. I help teams optimize their tech stacks, improve processes, and get accurate, actionable reporting. Whether it’s setting up your Marketing Automation Platform, building Salesforce reports, managing lead lifecycles, tracking attribution, or integrating your tech stack, I ensure everything is aligned to drive real results.

2 Comments

  1. Hey Jenna, I don’t understand where to paste the Step 4 text. Does that go into the Layout tab, Form Tab, or somewhere else?

    • Jenna Molby

      Hi Colin, You could put it in either the layout tab or the form tab.

Write A Comment