How to Properly Validate DatetimePicker

Josh

Please see attached code. I noticed that when the date portion was invalid I got the standard "date is not valid". However if only the time portion was invalid, the form would validate. So I added the custom rules scripting. That seemed to do the trick. However, now if the time is wrong, the message shows above the datetimepicker. If the date is wrong, it shows below the datetimepicker. If both are wrong it shows both messages duplicated. I must be doing something wrong. I've spend hours on this so I thought I'd ask. thank you.

Alexander Popov

I would recommend using the validation rule to check if the DateTimePicker widget value is null. In case it is null then either the date or the time is invalid and you should raise an error.
For convenience I prepared this small example, I hope it helps.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.