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 Field Validation

  1. How can I edit the date field so that it doesn't allow users to edit a past date?

    So, for example, if today was August 1st, the user can only select August 2nd, 3rd, 4th and so on.

    I took a look at the jQuery documentation (sense the date picker is from jQuery UI) but had no luck in finding anything.

    Any help is appreciated.

    Posted 12 years ago on Thursday August 25, 2011 | Permalink
  2. It is indeed the jQuery UI Date Picker. You will find lots of discussion on these forums about restricting the date to current or future dates. Here's are a couple recent discussions:

    http://www.gravityhelp.com/forums/topic/limit-date-field-to-only-current-date-and-future-dates
    http://www.gravityhelp.com/forums/topic/date-picker-not-restricting-users-to-previous-date

    Here are the full docs from jQuery. You probably want minDate:
    http://docs.jquery.com/UI/Datepicker#option-minDate

    Posted 12 years ago on Thursday August 25, 2011 | Permalink
  3. I tried the datepicker { mindate } property and it seems to work. The only problem is that the calender icon seems to disappear. Its not that big of a deal, just something I would like to be there.

    Here's the code I added to my file:

    $( "#input_6_12" ).datepicker({ minDate: +1});

    and here's my actual webpage: http://woodhavenlimousine.com/online-reservations/

    Thanks for any help

    Posted 12 years ago on Thursday August 25, 2011 | Permalink