Problem:
I've successfully implemented the following javascript for a single date field entry to only allow dates to be selected within the next 90 days, and not before 'Today':
jQuery(window).bind("load", function() { jQuery('[id^="cred_form_163_1-textfield"]').datepicker('option',{minDate: 0,maxDate: 90}); });
This also works for the 'first' field of a multiple date field, but I cannot find the id or class to apply the script to the second, third, etc, multiple instances of date fields
Solution:
You can use jQuery('.js-wpt-date[name^="wpcf-repeat-event-start-date-time"]').last() to locate the new datepicker.
For example, below JS codes:
jQuery(document).on( "toolset_repetitive_field_added", function() { jQuery('.js-wpt-date[name^="wpcf-repeat-event-start-date-time"]').last().datepicker('option',{minDate: 0,maxDate: 90}); });
Relevant Documentation:
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Hong_Kong (GMT+08:00)
This topic contains 5 replies, has 2 voices.
Last updated by 6 years, 10 months ago.
Assisted by: Luo Yang.