Skip Navigation

[Resolved] Toolset form – date field min date

This thread is resolved. Here is a description of the problem and solution.

Problem:
The customer reported that the custom script to limit the date range in the date type field in the Toolset Form is not working.

Solution:
Shared an example script to limit the date range in the date picker.

Relevant Documentation:
n/a

This support ticket is created 2 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

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/Karachi (GMT+05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by garenM 2 years, 5 months ago.

Assisted by: Waqar.

Author
Posts
#2385497

hey im adding the below code but it seems its not working. Can you please advise?

jQuery(document).bind('cred_form_ready', function(){
jQuery('#cred_form_45_1_1_date-of-birthdatepicker').datepicker('option',{minDate: -60,maxDate: -1});
});

#2386123

Hi,

Thank you for contacting us and I'd be happy to assist.

I've performed some tests on my website and this code works:


jQuery(window).bind("load", function() {
jQuery( 'input.js-wpt-date[data-wpt-name="wpcf-date-field-slug[display-only]"]' ).datepicker('option',{minDate: -60,maxDate: -1});
});

Note: Please replace "date-field-slug" with your date type field's slug.

regards,
Waqar

#2386401

My issue is resolved now. Thank you!