Returns a validation function to validate that a checkbox is checked.
Note: this differs from other required valiators as the value of the field must be true rather than not null.
Should only be used for fields that must be checked (e.g. agreement to terms or acknowledgement of a notice).
Parameters
OptionalisRequired: boolean
Indicates if the value is required to be true.
OptionalerrorMessage: string
A custom error message to display if the value is invalid.
Returns a validation function to validate that a checkbox is checked.
Note: this differs from other required valiators as the value of the field must be
truerather than not null. Should only be used for fields that must be checked (e.g. agreement to terms or acknowledgement of a notice).