I am trying to disable mondays on the default datepicker.
I have written and used the following code:
jQuery(document).ready(function($) {
$("[name='wpcf-datum-levering[display-only]']").datepicker(
{ beforeShowDay: function(day) {
var day = day.getDay();
if (day == 1) {
return [false]
} else {
return [true]
}
}
});
});
The code works but I cant submit the form. Whenever I manually initialize the datepicker, the fields returns "This field is required". Even if is not empty.
Hello. Thank you for contacting the Toolset support.
Well - can you please share problem URL and access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
There isn't such a built-in feature within Toolset form, it needs custom codes.
I have tried it in your website, after change the datepicker value, the hidden field "wpcf-datum-levering[datepicker]" value is still empty, see screenshot datepicker.JPG.
It conducts the problem you mentioned above: the fields returns "This field is required"
Toolset form validation will check the hidden field's value, and the date field's value should be timestamp format.
I suggest you try to remove your custom JS codes, and test again, then debug your custom JS codes manually, make sure it can fill value to the hidden field "wpcf-datum-levering[datepicker]".