limit time in date time field
-
- Posts: 76
- Joined: Wed Jan 21, 2015
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()
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()
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
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: 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.
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: 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
-
- Information
-
Who is online
Users browsing this forum: No registered users and 19 guests