Problem: How can I add callbacks to a custom datepicker field using custom JavaScript?
Solution: Use the Datepicker API from jQuery UI to hook into the onClose and onSelect events as needed:
jQuery(document).ready(function(){ jQuery('input.hasDatepicker').datepicker('option','onClose',function(){ console.log('close'); }); jQuery('input.hasDatepicker').datepicker('option','onSelect',function(){ console.log('select'); }); });
Relevant Documentation:
http://api.jqueryui.com/datepicker/#option-onClose
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.
This topic is split from https://toolset.com/forums/topic/limit-date-range-for-cred-form-date-field/
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 replies, has 3 voices.
Last updated by 6 years, 3 months ago.
Assisted by: Christian Cox.