PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

date drop down is showing years in the past

  1. alexdeluxe
    Member

    I have a villa rental page where people can book a house for their holiday. My booking form contents arrival and departure date. For these dates i like to show only years from now into future (2013 and higher). At the moment years in the past are shown, too which makes no sense for me. Any idea to change that? Thank you.

    Posted 11 years ago on Tuesday January 15, 2013 | Permalink
  2. krshoffner
    Member

    Are you using a dropdown, or the actual calendar field?
    If you have an URL to send, it would probably be helpful for the developers.

    Posted 11 years ago on Tuesday January 15, 2013 | Permalink
  3. alexdeluxe
    Member

    I am using dropdown because datepicker has js conflicts. Here is a link to the enquiry page: http://goo.gl/zmURt
    Thank you

    Posted 11 years ago on Tuesday January 15, 2013 | Permalink
  4. krshoffner
    Member

    Alex, one of the things I have read before about using the dropdown is how it uses a standard jQuery library, so you would have to do some modifications directly to that library.

    Here is where I read it before (http://www.gravityhelp.com/forums/topic/limit-date-field-to-only-current-date-and-future-dates-%E2%80%93within-wordpress)
    and basically you would probably need to do something like this
    $("#datepicker").datepicker({ minDate: 0 });
    in one of the library files.

    I am not able to tell you at the moment which file of the jQuery library you would need to modifiy, but hopefully this will get you started.

    Posted 11 years ago on Tuesday January 15, 2013 | Permalink
  5. alexdeluxe
    Member

    Thanks for your help. Will try that.

    Posted 11 years ago on Tuesday January 15, 2013 | Permalink
  6. David Peralty

    For the date dropdown, try the following code in your functions.php file:
    http://www.gravityhelp.com/documentation/page/Gform_date_min_year

    Posted 11 years ago on Tuesday January 15, 2013 | Permalink