# Update available dates in datepicker based on another field \[RESOLVED\]

**URL:** <https://community.gravityforms.com/t/update-available-dates-in-datepicker-based-on-another-field-resolved/15505>\
**Category:** Get Help\
**Tags:** custom, datepicker, gform\_datepicker\_options\_pre\_init\
**Created:** [July 11, 2023, 9:38pm UTC](https://community.gravityforms.com/t/update-available-dates-in-datepicker-based-on-another-field-resolved/15505 "2023-07-11T21:38:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user63f29f870edf2184](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user63f29f870edf2184/32/6752_2.png) [@user63f29f870edf2184](https://community.gravityforms.com/u/user63f29f870edf2184)\
**Post date:** [July 11, 2023, 9:38pm UTC](https://community.gravityforms.com/t/update-available-dates-in-datepicker-based-on-another-field-resolved/15505/1 "2023-07-11T21:38:11Z")

</div>

I am creating a form that allows users to book appointments.

The available dates depend on the value selected in a select, so they can change depending on the option chosen.

I see that with ‘gform\_datepicker\_options\_pre\_init’ I can make initial settings, but is it possible to update the configuration of the calendar depending on the value selected in the select?

Thank you.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [July 11, 2023, 9:46pm UTC](https://community.gravityforms.com/t/update-available-dates-in-datepicker-based-on-another-field-resolved/15505/2 "2023-07-11T21:46:52Z")

</div>

Can you use multiple datepickers, each configured differently, and show a different datepicker with conditional logic based on the selection in the dropdown?

If not, or you have too many options for this to be practical, or the options are always changing, then you would need to use jQuery or JavaScript to change the init options for the datepicker once a change is made in the select field.

---

<div class="post-metadata">

**Author:** ![user63f29f870edf2184](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user63f29f870edf2184/32/6752_2.png) [@user63f29f870edf2184](https://community.gravityforms.com/u/user63f29f870edf2184)\
**Post date:** [July 12, 2023, 10:10am UTC](https://community.gravityforms.com/t/update-available-dates-in-datepicker-based-on-another-field-resolved/15505/3 "2023-07-12T10:10:39Z")

</div>

Hi, Cris.

Yes, I already tried to modify the datepicker with jQuery, but I have not been able to access the instance created by Gravity Forms.

---

<div class="post-metadata">

**Author:** ![user63f29f870edf2184](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user63f29f870edf2184/32/6752_2.png) [@user63f29f870edf2184](https://community.gravityforms.com/u/user63f29f870edf2184)\
**Post date:** [July 12, 2023, 3:08pm UTC](https://community.gravityforms.com/t/update-available-dates-in-datepicker-based-on-another-field-resolved/15505/4 "2023-07-12T15:08:44Z")

</div>

Forget it, I was just making the wrong call with jQuery.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [July 13, 2023, 3:09pm UTC](https://community.gravityforms.com/t/update-available-dates-in-datepicker-based-on-another-field-resolved/15505/5 "2023-07-13T15:09:23Z")

</div>

Closed on July 13, 2023, 3:09pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
