Hello,
I have tried the below code, but it's not working -
https://toolset.com/forums/topic/disable-the-past-date-on-datepicker/
( function( $ ) {
$( document ).ready( function(){
$('.js-wpt-date').datepicker( "option", "minDate", "0" );
});
})( jQuery );
Hi Leila,
I've tested the slightly different code snippet shared by Julie in the same thread that you've mentioned and it is working on your form, as expected.
( ref: https://toolset.com/forums/topic/disable-the-past-date-on-datepicker/#post-1086572 )
You can change the value "2030" to increase or decrease the allowed future date range, as required.
( screenshot: hidden link )
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Great! It's working. Thanks
Is there a place to put this code to make it site wide, or would we just need to add it to all forms individually?
Hi Leila,
Thanks for the update and glad that it's working.
If you need to deploy different date picker requirements for different forms, it is better to include that script individually, in each form, so that it can be edited independently.
In case, the same script is needed for all cases site-wide, you can include it in the "Quick Javascript" field at WP Admin -> Appearance -> Theme Options.
Note: In this field, you'll need to wrap that code snippet in a script tag like this:
<script type="text/javascript">
actual code snippet
</script>
regards,
Waqar
My issue is resolved now. Thanks Waqar!