Date picker validation


#1

So I am using the javascript/jquery to create a date picker field. ( http://documentation.unbounce.com/hc/en-us/articles/203799174?&_ga=1.151425657.1990160284.142473… )

How do I go about updating the javascript to prevent a user from selecting a date in the past?


#2

Disregard…I figured it out.


#3

I have the same problem. How did you get this sorted ?


#4

Hi @Akshada try adding

minDate: 0

to the datepicker function. Setting the minDate value to 0 will prevent anyone from picking a date in the past.

Hope this helps!


#5

Hi @Rob
Is there also a solution for pre-selecting a total timeframe?
For example if there is a promotion just for the next 3 weeks, I want the participants to choose a time just within this timeframe. what do I need to set as maxDate?