How to create a future-only date field

Kelly_Bakalich
Level 1

How to create a future-only date field

I'm creating a form for students to fill out that includes their graduation date. I need the "date of graduation" field to have a default value of "today", and cannot select a past date.

 

Can someone help me figure out how to do this?

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: How to create a future-only date field

The key is to use a Text field (not Date) and then mark it up using a JS datepicker library that supports min/max cross-browser (there's no native support for this that works in all browsers). Search my past posts for "Kalendae", it's been discussed before w/examples.


EDIT: In Kalendae your options object would be

 

{
  format: "YYYY-MM-DD",
  diretion: "future",
  selected: Kalendae.moment()
}

 

That sets the format (obviously), the direction to be future-only, and the default to be today.

SanfordWhiteman
Level 10 - Community Moderator

Re: How to create a future-only date field

@Kelly_Bakalich did you see this response?