Validators are used to validate input fields in a ShinyForm. Validators are to be used with the validatedInput function. A single input field can have several validators.
Package shinyreformss defines a set of commonly used pre-defined Validators. These include:
Will fail if string is shorter than minLength.
Will fail if string is longer than maxLength.
Will fail if string is empty.
testFunction returning a boolean value which will be used to validate input.
failMessageError message to display when validation fails.
new()Creates a Validator object.
Validator$new(test, failMessage)
testA function to test the input. Should take a single value as input and return a boolean.
failMessageA fail message to be displayed.
check()Performs a check on the input.
Validator$check(value)
valueInput value to be tested.
TRUE if the check passes, FALSE if otherwise.
clone()The objects of this class are cloneable with this method.
Validator$clone(deep = FALSE)
deepWhether to make a deep clone.