StaticbasicBasic 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.
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticbooleanValidate an input as a boolean value.
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticdateCheck that a valid date input is given. Uses MomentJS
MomentJS date format
Optionallocale: string | null = nullMomentJS locale
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticdbCheck that the given value is unique in the database
Optionalcfg: default | null = nullValidation options
Optionalcolumn: string | null = nullColumn name to use to check as a unique value. If not given the host field's database column name is used
Optionaltable: string | null = nullTable to check that this value is uniquely valid on. If not given the host Editor's table name is used
Optionaldb: Knex<any, any[]> | null = nullDatabase connection. If not given the host Editor's database connection is used
Configured validation function
StaticdbCheck 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.
Optionalcfg: default | null = nullValidation options
Optionalcolumn: string | null = nullColumn name to use to check as a unique value. If not given the host field's database column name is used
Optionaltable: string | null = nullTable to check that this value is uniquely valid on. If not given the host Editor's table name is used
Optionaldb: Knex<any, any[]> | null = nullDatabase connection. If not given the host Editor's database connection is used
Configured validation function
StaticemailValidate an input as an e-mail address.
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticfileCheck that the uploaded file has a given extension
Allowed extensions
Error message to return if not valid
Configured validation function
StaticfileCheck that the uploaded file is equal or less than a given size.
Max file size in bytes
Configured validation function
StaticipValidate as an IP address.
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticmaxValidate a string is less or equal to a maximum length.
Maximum length
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticmaxCheck for a numeric input and that it is less than a given value.
Maximum value
Optionaldecimal: string = '.'Character to use as the decimal place
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticminValidate a string has a minimum length.
Minimum length
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticminRequire a string with a certain minimum or maximum number of characters.
Minimum length
Maximum length
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticminCheck for a numeric input and that it is in between two given values.
Minimum value
Maximum value
Optionaldecimal: string = '.'Character to use as the decimal place
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticminCheck for a numeric input and that it is greater than a given value.
Minimum value
Optionaldecimal: string = '.'Character to use as the decimal place
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticmjoinRequire 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
StaticmjoinRequire 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
StaticnoneNo validation - all inputs are valid
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticnoEnsure that the submitted string does not contain HTML tags
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticnotOptional field, but if given there must be a non-empty value
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticnumericCheck that any input is numeric.
Optionaldecimal: string = '.'Character to use as the decimal place
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticrequiredRequired field - there must be a value and it must be a non-empty value
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticurlValidate as a URL.
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticvaluesConfirm that the value submitted is in a list of allowable values
List of values that are valid
Optionalcfg: default | null = nullValidation options
Configured validation function
StaticxssCheck if string could contain an XSS attack string
Optionalcfg: default | null = nullValidation options
Configured validation function
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 Field.validator method.
Each method may define its own parameters that configure how the formatter operates. For example the
minLenvalidator takes information on the minimum length of value to accept.Additionally each method can optionally take a
ValidationOptionsinstance that controls common validation options and error messages.The validation functions return
truefor valid data and a string for invalid data, with the string being the error message.Validator