Do you need users to pick a date when they fill in a form on your website?
Perhaps you want to know a good time to call them, or maybe you want to gather information such as date of birth, etc. That’s where a date picker field can help.
In this article, we will show you how to easily create a WordPress form with a date picker.
Why Create a WordPress Form With a Date Picker?
Adding a date picker to a form on your WordPress website makes it easier for users to input dates accurately and quickly, compared to manually typing them out.
This ensures that the date format remains consistent across all form submissions, reducing the chances of errors.
Adding a date picker also helps in better data organization for dates in WordPress forms and improves the user experience.
For example, if you have an appointment or hotel booking form on your website, then a date picker field makes it super easy for guests to select their check-in and check-out dates to book their stay.
Having said that, let’s see how to easily create a WordPress form with a date picker.
How to Create a WordPress Form With a Date Picker
You can easily create a WordPress form with a date picker using WPForms.
It is the best WordPress contact form plugin on the market that makes it super easy to create all sorts of forms on your WordPress site.
Note: You can also use WPForms Lite to create a WordPress form with a date picker. However, we will be using the premium version of the plugin for this tutorial.
Upon activation, head over to the WPForms » Add New page from your WordPress admin sidebar.
This will direct you to the ‘Select a Template’ page, where you can start by typing a name for the new form that you are about to create.
After that, select a pre-made form template from the list by clicking the ‘Use Template’ button under it.
For this tutorial, we will be creating a simple contact form for WordPress.
This will launch the WPForms form builder on your screen, where you will notice the field options in the right column and a form preview in the left corner of the screen.
The default contact forms template has the name, email address, and comments field added to the form. However, you can easily change that by adding a form field of your choice from the left column.
For detailed instructions, you may want to see our tutorial on how to create a contact form in WordPress.
Now, it’s time for you to add the date picker field to your WordPress form.
To do this, scroll down to the Fancy Fields section in the left column, where you will see the Date/Time field.
Simply drag and drop the field to where you want it on your form. For the sake of this tutorial, we’ve placed it just below the Email field.
Once you’ve done that, click on the ‘Date/ Time’ field to edit it. This will open up the ‘Field Options’ tab on the left-hand side of your screen.
From here, you can change the label of the field, which defaults to ‘Date / Time’. We are going to use ‘Preferred Time for Phone Call’ for our field.
You can also change the date format of the field using the Format dropdown menu. For instance, you might want to use just a date and no time field to collect the date of birth of users.
You can also check the ‘Required’ box if you want to make this a mandatory field. This means the user will have to select a date and time before they can submit the form.
Once you have done that, just click the ‘Save’ button at the top to store your form settings.
Setting Advanced Options for Your Date Picker Field
By default, the date picker field on your WordPress form will be a calendar with a time dropdown menu next to it.
The user will simply need to click on a day to select the date of their preference.
Similarly, the time dropdown also defaults to a 12-hour clock with 30-minute intervals.
From here, users can select a time that works well for them. For example, if you have a booking form on your site, then users can use this field to add a time for their appointment.
However, you might want to change how the date picker works.
To do this, you’ll have to click on the ‘Date / Time’ field to configure its settings in the left column of the form builder.
From here, switch to the ‘Advanced’ tab from the top of the column.
Next, scroll down to the ‘Date’ section, where you can change the date picker type, date format, and add placeholder text.
You can also limit the date range to adjust which days of the week can be selected by toggling the ‘Limit Days’ switch.
You can also switch from your date picker to a date dropdown if you prefer.
In this case, the user selects the month, day, and year from dropdown boxes like this:
After that, scroll down to the ‘Time’ section to change the time picker.
It defaults to a 12-hour clock, but you can switch this to a 24-hour clock if you prefer. You can also change the intervals to 15 minutes or 1 hour instead of 30 minutes.
Once you are happy with your form, you can save it by clicking the ‘Save’ button in the top right corner of the screen.
You may also want to set up your form so that the person completing the form gets a copy of the details they submitted.
This could be helpful if they are scheduling a call with you. They’ll have an email record of the call time they booked.
To do this, you can have a look at our tutorial on creating a contact form with multiple recipients.
Adding Your Form to Your Website
To add the form with a date picker to your WordPress blog, open up an existing or new page/post from the WordPress admin sidebar.
Once you are there, just click the ‘+’ button in the top left corner of the screen to open up the block menu.
From here, you can now locate and add the WPForms block to the page/post.
Next, you’ll need to select the form you just created from the dropdown menu in the block itself.
That’s all you need to do. You can now publish your page, and your form will be live on your website. It should look something like this:
Note: The styling of the form will depend on the WordPress theme you are using.
All forms created with WPForms are mobile-friendly out of the box and will work on any mobile device. WPForms date-picker tool is also mobile-friendly and works on all screen sizes.
However, it’s always a good idea to test out your form to make sure it’s working as you expected. If you aren’t getting emails, but you are sure your notification settings are correct, our article on how to fix the WordPress not sending email issue should help.
You can make changes to your form by going to the WPForms » All Forms page from the WordPress dashboard.
Once you are there, just click on the title of your form or the ‘Edit’ link under the title to edit it.
Once you save your form, it will be updated on your website automatically.
Taking Your Form to the Next Level
Aside from creating a form with a date picker, you can build even more powerful forms with the WPForms plugin.
Plus, you can accept online payments right from your date picker form via popular payment gateways like Stripe, PayPal, Square, and Authorize.net. You can collect one-time or recurring payments, and there’s no additional transaction fees.
Even the free version of WPForms allows you to collect Stripe payments with only a 3% transaction fee.
For step by step instructions, see this tutorial on how to accept credit card payments in WordPress.
We hope this article helped you learn how to create a WordPress form with a date picker. You might also want to take a look at our tutorial on how to block contact form spam in WordPress and our expert picks for the best WordPress plugins to help grow your site.