Beautiful Marketo Forms: Styling Checkboxes and Radio Buttons

In:

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.

Before we begin…

Let’s refresh on how to add custom CSS to your Marketo forms.

Navigate to the form and open up the form editor. Click on Form Settings > Form Theme > Edit Custom CSS this is where you can paste in your own CSS.

marketo-form-styling-edit-custom-css

Marketo requires that you select one of their themes to start. Changing themes will affect the CSS. For this tutorial, I will be using the “simple” theme which is the default theme when you create a new form.

marketo-form-theme-settings

Note: If you don’t select the “simple” theme for your form this tutorial won’t be copy & paste.

Styling Checkboxes

One of the downsides of using Marketo forms is the inability to modify the HTML structure of the form, so I will be leveraging the standard Marketo HTML to style the checkboxes.

The HTML

The standard HTML for a checkbox in a Marketo form looks like this:

Notice how the all the checkboxes are wrapped in a DIV with the class mktoCheckboxList? This is how we will target the checkbox input and the checkbox label within the CSS.

The CSS

For the CSS, FontAwesome will be loaded to display the checkmark for the checkbox. The default checkbox will be hidden and the ::before selector will be used to style the new checkbox.

The Result

The styled checkboxes will look like this once the CSS has been added to the Marketo form.

See the Pen Marketo Customized Checkboxes Using CSS (option 1) by Jenna Molby (@jennamolby) on CodePen.

Styling Radio Buttons

Styling radio buttons are pretty similar to the checkboxes, but with a bit of extra CSS to make them look like a radio button. Just like the checkboxes, we will leverage the HTML that Marketo provides, so all you have to do is add some CSS.

The HTML

All radio buttons in the Marketo form are wrapped in a DIV with the class mktoRadioList. This is how we will target the radio input and the radio label within the CSS.

The CSS

Just like the CSS for the checkboxes, FontAwesome will be loaded to display the checkmark for the radio button and the default radio button will be hidden.

The Result

See the Pen Marketo Customized Radio Buttons Using CSS (option 1) by Jenna Molby (@jennamolby) on CodePen.

Special thanks to Karen Menezes who wrote a great tutorial on pure CSS checkboxes, which I referenced to make this Marketo tutorial.

Questions?

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

Related Posts

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

  • 27/10/2016
    How to Create a 2 Column Pardot Form

    After launching my Form Style Generator for Pardot Forms, the number one question I receive is ‘how do I create a 2 column form in Pardot?’ I might update the style generator to include this in the future, but in the meantime, here’s how to create a 2 column Pardot form with minimal coding.

  • 23/08/2016
    How to Improve Pardot Form Conversions by Using Google Places

    It’s a fact that shorter forms have a higher conversion rate, but in B2B marketing longer forms are needed to capture essential information for lead scoring and lead routing. In this tutorial, I will show you how to use the Google Places API to auto-fill city, state/province, country and postal code/zip code within your Pardot forms. Don’t worry, you don’t need to know how to code to implement this, you just need to know how to copy & paste.

3 comment(s)
  • Bear F

    23/08/2017 at 8:56 am
    Reply

    Great tutorial, copy pasted your code in and my Marketo checkboxes are much nicer now.

  • Brie

    15/08/2017 at 9:39 am
    Reply

    hello!! I was curious if you knew how to make the radio buttons next to each other opposed to two lines- so I have a yes, no radio button and i want them on one line opposed to two?? Any guidance is greatly appreciated. Thank you!

    • Jenna Molby
      to Brie

      15/08/2017 at 11:17 am
      Reply

      Hi Brie, You can add this CSS to your form to make the radio buttons side-by-side .mktoForm .mktoRadioList > label {float:left !important;clear:none !important;margin-left:5px !important; margin-right:10px !important;}

Leave A Comment

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

About Me

I am a results focused marketing automation expert, with a strong background in design and development. With a high level computer science background, I have the unique ability to design, code and understand data, while utilizing this skillset to further enhance my value and ROI in the digital marketing space.
LEARN MORE

Categories
Most Commented
Popular Posts