Title: Datepicker problem
Last modified: May 18, 2020

---

# Datepicker problem

 *  Resolved [kare93](https://wordpress.org/support/users/kare93/)
 * (@kare93)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/datepicker-problem-3/)
 * Hello,
 * I need your help. When i choose a date, i would like to disable the previous 
   ones. How can i make this happen?
 * I often use this code for contact form 7 and datepicker for contact form 7:
 * /* code */
    function calendar_js(){ ?> <script> jQuery(function($){ var start
   = $(‘.date-417 input’).first(); var end = $(‘.date-419 input’).first();
 *  start.on(‘change’, function() {
    var start_date = $(this).datepicker(‘getDate’);
   start_date.setDate(start_date.getDate() + 1); end.datepicker(‘option’, ‘minDate’,
   start_date); }); }); </script> <?php } add_action(‘wp_footer’, ‘calendar_js’);
 * Thank you in advance.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdatepicker-problem-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Fahad Mahmood](https://wordpress.org/support/users/fahadmahmood/)
 * (@fahadmahmood)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/datepicker-problem-3/#post-12851465)
 * You are asking for a custom script, this support forum is about plugin related
   features or problems.
 * minDate : 0
 * Should work for you, but as you are setting setting minDate to selection of previous
   input field. I would suggest you to post your problems on relevant support forum.

Viewing 1 replies (of 1 total)

The topic ‘Datepicker problem’ is closed to new replies.

 * ![](https://ps.w.org/wp-datepicker/assets/icon-256x256.gif?rev=2286804)
 * [WP Datepicker](https://wordpress.org/plugins/wp-datepicker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-datepicker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-datepicker/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-datepicker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-datepicker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-datepicker/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Fahad Mahmood](https://wordpress.org/support/users/fahadmahmood/)
 * Last activity: [5 years, 12 months ago](https://wordpress.org/support/topic/datepicker-problem-3/#post-12851465)
 * Status: resolved