limit time in date time field

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
davidnarramore
Posts: 76
Joined: Wed Jan 21, 2015

05 Jan 2018

I have the following JavaScript code to limit the time selection in two date time fields called StartDate and EndDate. This was working perfectly until I upgraded to the latest forms designer version. I have tried to resave the forms, but it still doesn't work. Any help would be appreciated.

fd.field('StartDate').control()._el().find('select:eq(0) > option').filter(function() { return $(this).index() < 8 || $(this).index() > 20 }).remove()

fd.field('EndDate').control()._el().find('select:eq(0) > option').filter(function() { return $(this).index() < 8 || $(this).index() > 20 }).remove()

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

06 Jan 2018

Dear David,
The code works just fine for me with the latest version of Forms Designer. Let's figure out why it doesn't in your case. First thing, please make sure that the fields StartDate and EndDate have Template: Default setting, this code wouldn't work with Kendo DateTimePicker:
DefaultTemplate.png
DefaultTemplate.png (18.62 KiB) Viewed 1651 times
If the Template is set to Default, please, open the console in the browser on the form and check if it has any errors. A screenshot of the console might help us determine the reason of the error.
Cheers

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests