Example of Field Validation in Blazor Scheduler Component
This demo shows the way of adding default and custom validation rules to the editor fields of Scheduler.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
In this demo, the specific fields of Scheduler editor window such as Subject
, Location
, Description
, StartTime
and EndTime
are made to undergo validation such that if it is left as blank, then the default required validation message will be displayed in a separate tooltip, on clicking a save button.
Additionally, the regex condition has been added to the Location
field, so that if any special characters are typed into it, then the custom validation message will be displayed. The
Description
field has been validated to restrict the character count to be typed into it between 5 and 500 and not beyond that. This validation can be given by using the
Validation property available within each ScheduleField of the ScheduleEventSettings
property.
Apart from this validation feature, the built-in validation has been provided to the start and end time fields, so that when the selected end time occurs before the start time, a validation message will be displayed as well as when some unwanted characters are typed into the date fields, the invalid date message will be alerted.