Title: Disable Certain Datepicker Fields
Last modified: November 10, 2023

---

# Disable Certain Datepicker Fields

 *  Resolved [TheBusinessCat](https://wordpress.org/support/users/thebusinesscat/)
 * (@thebusinesscat)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/disable-certain-datepicker-fields/)
 * Hi there,
 * I need to use a datepicker field, and require the year field only, not the day
   and month. This is to select the vehicle year on the form, so a day and month
   would not make sense. I also need this field to be a required field.
 * I found this [post](https://wordpress.org/support/topic/date-field-disable-day/)
   and used the code mentioned in this [link](https://gist.github.com/wpmudev-sls/03cc9a37301f20c3199bc1437fe6ab6d).
   Using this hides the day and month field, however it seems the form will not 
   submit as it is only hidden, and not totally disabled.
 * Can this code be amended so that the datepicker field can be a required field
   and display only the year field?
 * I know I can add a select field and put all the years as options, but this would
   seem cumbersome.
 * Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/disable-certain-datepicker-fields/#post-17192019)
 * Hi [@thebusinesscat](https://wordpress.org/support/users/thebusinesscat/)
 * I hope you are doing well today.
 * > I know I can add a select field and put all the years as options, but this 
   > would seem cumbersome.
 * Not at all. Please try to generate all required years in google sheet, copy them
   and use “Bulk Edit” in select. Before you create google sheet, please enable 
   bulk edit in select which will show you csv template how it should look like.
 * Kind Regards,
   Kris
 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/disable-certain-datepicker-fields/#post-17214515)
 * Hi [@thebusinesscat](https://wordpress.org/support/users/thebusinesscat/)
 * We haven’t heard from you in a while, I’ll go and mark this thread as resolved.
   If you have any additional questions or require further help, please let us know!
 * Kind Regards,
   Kris

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Disable Certain Datepicker Fields’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

## Tags

 * [datepicker](https://wordpress.org/support/topic-tag/datepicker/)

 * 2 replies
 * 2 participants
 * Last reply from: [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/disable-certain-datepicker-fields/#post-17214515)
 * Status: resolved