Basic validation - this is used to perform the validation provided by the
validation options only. If the validation options pass (e.g. required
,
empty
and optional
) then the validation will pass regardless of the
actual value.
Configured validation function
Validate an input as a boolean value.
Configured validation function
Check that a valid date input is given. Uses MomentJS
MomentJS date format
Configured validation function
Check that the given value is unique in the database
Configured validation function
Check that the given value is a value that is available in a database -
i.e. a join primary key. This will attempt to automatically use the table
name and value column from the field's Options
method (under the
assumption that it will typically be used with a joined field), but the
table and field can also be specified via the options.
Configured validation function
Validate an input as an e-mail address.
Configured validation function
Check that the uploaded file has a given extension
Allowed extensions
Error message to return if not valid
Configured validation function
Check that the uploaded file is equal or less than a given size.
Max file size in bytes
Configured validation function
Validate as an IP address.
Configured validation function
Validate a string is less or equal to a maximum length.
Maximum length
Configured validation function
Check for a numeric input and that it is less than a given value.
Maximum value
Configured validation function
Validate a string has a minimum length.
Minimum length
Configured validation function
Require a string with a certain minimum or maximum number of characters.
Minimum length
Maximum length
Configured validation function
Check for a numeric input and that it is in between two given values.
Minimum value
Maximum value
Configured validation function
Check for a numeric input and that it is greater than a given value.
Minimum value
Configured validation function
Require a maximum value of the number of options / values submitted in an array
Max array size required to be valid
Error message
Configured validation function
Require a minimum value of the number of options / values submitted in an array
Min array size required to be valid
Error message
Configured validation function
Ensure that the submitted string does not contain HTML tags
Configured validation function
No validation - all inputs are valid
Configured validation function
Optional field, but if given there must be a non-empty value
Configured validation function
Check that any input is numeric.
Configured validation function
Required field - there must be a value and it must be a non-empty value
Configured validation function
Validate as a URL.
Configured validation function
Confirm that the value submitted is in a list of allowable values
List of values that are valid
Configured validation function
Check if string could contain an XSS attack string
Configured validation function
Generated using TypeDoc
Validation methods for DataTables Editor fields. All of the methods defined in this class return a function that can be used by Field instance's {@link Field.Validator} method.
Each method may define its own parameters that configure how the formatter operates. For example the
minLen
validator takes information on the minimum length of value to accept.Additionally each method can optionally take a
ValidationOptions
instance that controls common validation options and error messages.The validation functions return
true
for valid data and a string for invalid data, with the string being the error message.