FAQ search

Date control using CFv5 date picker element

Details

Published: Monday, 07 April 2014 13:13

In CFv5, you can control the dates open using the Datepicker element ‘Extra params’ box, here is a list of some of the available settings.

Update: more recent versions of ChronoForms have an Advanced tab in the DatePicker element settings. This tab has boxes where you can enter some of these settings directly. If you use these boxes only enter the part after the = in examples below.

Start date

In order to disable all dates before a specific date, you can enter this in the ‘Extra params’ box:

data-start_date=25-03-2014

Please note that the start date format must be in the same format that is set in the Datepicker 'Format' setting.

You can also use PHP to build a dynamic start date.

For example, this will set the start date to today.

data-start_date=<?php echo date("d-m-Y"); ?>

And to have this set on page load you need to use this code in a "Load JS" action: