This sample explains the Data Validation feature with the gross pay calculation as an example. It is used to restrict the data that the user enters into a cell. To clear the applied validation, click the Data Validation
button in the Data tab and Clear Validation
option. You can also highlight the invalid data by selecting Highlight Invalid Data
option.
ValidationModel
as argument.
TextLength
validation to provide proper name with more than 3 text length.
In time in and time out column, we have provided Time
validation for working hours between 8.00 AM to 6.00 PM. In the weekdays column, we have used List
validation for weekdays (Monday to Friday).
WholeNumber
validation to find out overtime calculation(i.e more than 8 hours). And also, we used the addInvalidHighlight to highlight the overtime hours of the employee.
WholeNumber
validation.
In this validation, we have used the input value as the cell reference. It helps in changing the criteria dynamically.
More information about the Data Validation can be found in this documentation section.