How to Create a Better Date Picker Within Pardot Forms


Want to be able to restrict the date range of a date picker within your Pardot forms? The default date picker with Pardot does not provide this option, but with a couple of lines of JavaScript, you can enhance the functionality of the date picker. In this tutorial, I’ll show you how to use the jQuery UI date picker within your Pardot form.

Step 1: Add the field to your form

Add the field to your form. Since we won’t be using the default date picker leave the type as TEXT.

Step 2: Add the JavaScipt to your form

In the form editor, go to step #3 – look & feel and click on the below form section. Copy & paste this JavaScript in the HTML editor.

Step 3: Edit the script

There are a couple of changes you need to make to the script in order for it to work with your form:

  1. Update YOURDATEFIELDNAME with the name of your Pardot field that should launch the date picker.
  2. Update minDate with the number of days in the past the user should be able to see and select. For example “0” would not show any dates in the past. “-20” would allow the user to select up to 20 days in the past.
  3. Update maxDate with the number of days in the future the user should be able to select. For example, “+1M” would allow the user to select a date that is 1 month in the future.

Step 4:

Save and test! Your date picker should look like the one below and if you fill out the form the date should populate within Pardot in the yyyy-mm-dd format.


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

Related Posts

  • 23/07/2020
    How to Add an Opt-in Message & Privacy Policy Message to Pardot Forms

    GDPR and CASL compliance are just a few reasons to add an explicit opt-in message or a privacy policy to your Pardot forms. In this post, I’ll show you how to add a custom opt-in message to your form and a privacy consent message above the form submit button.

  • 23/06/2020
    How to Use Pardot Form Handlers

    Pardot form handlers allow you to use your own forms to post your data to Pardot. A Form handler is a great alternative to use instead of Pardot iFrame forms. They allow you to fully customize the look of your form and submit data to more than 1 database. In this tutorial, you will learn how to create a form handler from scratch.

  • 09/10/2019
    Creative Ways to Spice Up Your Pardot Forms: Part 2

    The 2nd part of the form customization series is finally here! In part 1, I showed you how to implement the popular floating label technique and how to create searchable, user-friendly dropdowns. In this post, I will show you how to create a conversational, paragraph-style form and how to create a form on a single line.

4 comment(s)
  • Partha Dave

    05/05/2020 at 2:46 am

    Hi, this doesnt seem to work for me, i think there may be some conflict with what the pardot field name is, is this is the label of the field or the prospect field name?

    • Jenna Molby
      to Partha Dave

      09/05/2020 at 12:05 pm

      Hi Partha, It's the prospect field name. If you are still having issues you can send me the link to your landing page to [email protected] and I can confirm that the name is correct. Cheers, Jenna

  • Jon McMinn

    06/04/2020 at 1:35 pm

    Love this solution, Jenna! Is it possible to restrict the days available (for instance, prevent someone from selecting a weekend day)?

    • Jenna Molby
      to Jon McMinn

      09/04/2020 at 10:48 am

      Thank you :). The easiest way to not allow someone from selected a weekend day is to hide the weekends using CSS, like this: th.ui-datepicker-week-end, td.ui-datepicker-week-end { display: none; }. Cheers, Jenna

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 Marketing Operations leader.

Most Commented
Popular Posts