Skip Navigation

[Resolved] I want to disable mondays on the datepicker

This support ticket is created 5 years, 7 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/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 2 replies, has 3 voices.

Last updated by Luo Yang 5 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1232194
Image 1005.png

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.

#1232209

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

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.

#1232707
datepicker.JPG

Hello,

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