The reservation post type has 2 custom date fields: arrival date and departure date. People should only be able to select dates within a certain timeframe in the future, AND the departure date should be later than the arrival date.
Where the id is the id of input type="text". I also tried id "cred_form_9010_1_1_aankomstdatumdatepicker", which is from input type=hidden, and id "cred_form_9010_1_1_aankomstdatum".
On my local test I had the first part working (start date must be in the future for up to 90 days), now I need to add the second part where the end date is tied to the date chosen for the start date, but I've overrun my time today.
Please bear with me, I'll share the solution in the morning.
You'll want to add this code to the custom JS section of your form. You will need to edit your custom field slugs for the start and end dates (in the example the field slugs are "start-date" and "end-date".
jQuery(window).bind("cred_form_ready", function() {
// register callback for when start date is set to update end date
const toolset_date_range_handler = function( date, datepicker ) {
// date isn't ready in time, so create the date
date = new Date( datepicker.selectedYear, datepicker.selectedMonth, datepicker.selectedDay );
// update the minimum end date to match the chosen start date
jQuery("input[name='wpcf-end-date[display-only]']").datepicker('option', 'minDate', date );
};
// limit date range for start date (& end date initially) & add start date event listener
jQuery("input[name='wpcf-start-date[display-only]']").datepicker('option', {minDate: 0, maxDate: 90, onClose: toolset_date_range_handler});
jQuery("input[name='wpcf-end-date[display-only]']").datepicker('option',{minDate: 0,maxDate: 90});
});