DateTime Picker min and max to restrict date selection

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Hnin Yu
Posts: 14
Joined: Fri Jun 07, 2019

06 Dec 2019

Hello,

I would like to restrict date within 3 days(Include current days) using DateTime Field with custom in spform.User cannot be restrict the Next Day(Future Time).
Eg. Today is 6/12/2019.User can be select 4/12/2019 or 5/12/2019 or 6/12/2019 .But they cannot select and the next day or the previous of these days must be disable.
So,Please help me how can I do it ?
Attachments
pp.png
pp.png (29.01 KiB) Viewed 3121 times

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

06 Dec 2019

Hello Hnin Yu.

Please find the example of how to disable dates in the calendar in this post:
viewtopic.php?f=1&t=3151

Hnin Yu
Posts: 14
Joined: Fri Jun 07, 2019

09 Dec 2019

Hello ,

Thanks.It is very help for me.But one thing let me know how can I readonly for this DateTime Picker(Kendo DateTime).I can select limited date but it can change it manually.So,I think it need to do readonly function in this DateTime Picker.

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

09 Dec 2019

Hnin Yu,

Manual input will not be saved if it is not in the allowed range of dates.

But you can also disable the field itself with the following code:

Code: Select all

function disableDtae() {
  if (fd.field('Date').value()) {

    fd.field('Date').readonly(true);
  }
}

fd.field('Date').change(disableDtae);

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests