Tell us what you are trying to do?
On a website where producers declare their films, I have a form with three dates :
- Date de mise en production (production start date)
- Date de fin de tournage (end of shooting)
- Date de fin de post-production (end of post-production)
I need to :
1 - make sure that the dates are in the right order
2 - send alerts to specific emails (present in the form too) a few day before the dates.
Is there any documentation that you are following?
1 - Making sure that the dates are in the right order :
I have done that adapting a code found on your support forums (https://toolset.com/forums/topic/select-a-date-that-is-not-before-the-first-date-field/) :
-> I have managed to control the datepickers. When the start date is entered, users cannot select a previous date for other fields.
-> But, then, the form validation says that "You must enter a date"... Impossible to register my dates in the database and to validate the form.
jQuery(document).ready(function() {
var fromId = jQuery('input[name="wpcf-date-de-mise-en-production[display-only]"').attr('id');
var intId = jQuery('input[name="wpcf-date-de-fin-de-tournage[display-only]"').attr('id');
var toId = jQuery('input[name="wpcf-date-de-fin-de-post-production[display-only]"').attr('id');
var $from = jQuery( '#' + fromId );
var $int = jQuery( '#' + intId );
var $to = jQuery( '#' + toId );
$from.datepicker('option', 'dateFormat', 'd MM yy' );
$from.datepicker('option', 'minDate',0);
$from.datepicker('option', 'onSelect', function( selectedDate, obj ) {
$int.datepicker( "option", "minDate", selectedDate );
});
$int.datepicker('option', 'dateFormat', 'd MM yy' );
$int.datepicker('option', 'onSelect', function( selectedDate, obj ) {
$from.datepicker( "option", "maxDate", selectedDate );
$to.datepicker( "option", "minDate", selectedDate );
});
$to.datepicker('option', 'dateFormat', 'd MM yy' );
$to.datepicker('option', 'onSelect', function( selectedDate, obj ) {
$int.datepicker( "option", "maxDate", selectedDate );
});
});
2 - send alerts to specific emails (present in the form too) a few day before the dates.
My reference is also a thread in the support forum : https://toolset.com/forums/topic/send-e-mail-notifications-at-individual-dates/
The instructions are clear, I can create a notification and a condition.
But I'm not sure where and how to add the recipients and the text of the email alert.
What is the link to your site?
hidden link
(password : reaumur)