Blazor Scheduler Example - Field Validation
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This demo shows the way of adding default and custom validation rules to the editor fields of Scheduler.
In this demo, specific fields of the Scheduler editor window such as Subject, Location, Description, StartTime, and EndTime are made to undergo validation. If these fields are left blank, a default required validation message is displayed in a separate tooltip when clicking the save button.
Additionally, a regex condition has been added to the Location field, so that if any special characters are typed into it, a custom validation message is displayed. The Description field has been validated to restrict the character count to be between 5 and 500 characters, 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, built-in validation has been provided to the start and end time fields. When the selected end time occurs before the start time, a validation message is displayed. Additionally, when unwanted characters are typed into the date fields, an invalid date message is alerted.