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 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.

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by garenM 1 month, 4 weeks ago.

Assigned support staff: 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

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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!