Click or drag to resize
Validation Class
Validation methods for DataTables Editor fields. All of the methods defined in this class return a delegate that can be used by
Field
instance's
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
ValidationOpts
instance that controls common validation options and error messages. The validation delegates return `null` for validate data and a string for invalid data, with the string being the error message.
Inheritance Hierarchy
SystemObject
  DataTablesValidation

Namespace:  DataTables
Assembly:  DataTables (in DataTables.dll) Version: 1.6.5.0 (1.6.5.0)
Syntax
C#
public class Validation

The Validation type exposes the following members.

Constructors
  NameDescription
Public methodValidation
Initializes a new instance of the Validation class
Top
Methods
  NameDescription
Public methodStatic memberBasic
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.
Public methodStatic memberBoolean
Validate an input as a boolean value.
Public methodStatic memberDateFormat
Check that a valid date input is given
Public methodStatic memberDbValues
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.
Public methodStatic memberEmail
Validate an input as an e-mail address.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberIp
Validate as an IP address.
Public methodStatic memberMaxLen
Validate a string does not exceed a maximum length.
Public methodStatic memberMaxNum(Decimal, ValidationOpts)
Check for a numeric input and that it is less than a given value.
Public methodStatic memberMaxNum(Decimal, String, ValidationOpts)
Check for a numeric input and that it is less than a given value.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberMinLen
Validate a string has a minimum length.
Public methodStatic memberMinMaxLen
Require a string with a certain minimum or maximum number of characters.
Public methodStatic memberMinMaxNum(Decimal, Decimal, ValidationOpts)
Check for a numeric input and that it is both less than and greater than given values
Public methodStatic memberMinMaxNum(Decimal, Decimal, String, ValidationOpts)
Check for a numeric input and that it is both less than and greater than given values
Public methodStatic memberMinNum(Decimal, ValidationOpts)
Check for a numeric input and that it is greater than a given value.
Public methodStatic memberMinNum(Decimal, String, ValidationOpts)
Check for a numeric input and that it is greater than a given value.
Public methodStatic memberNone
No validation - all inputs are valid.
Public methodStatic memberNoTags
Ensure that the submitted string does not contain HTML tags
Public methodStatic memberNotEmpty
Optional field, but if given there must be a non-empty value
Public methodStatic memberNumeric
Check that any input is numeric.
Public methodStatic memberRequired
Required field - there must be a value and it must be a non-empty value
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic memberUnique(ValidationOpts, String, String, Database)
Check that the given value is unique in the database
Public methodStatic memberUniqueT(ValidationOpts, String, String, Database)
Check that the given value is unique in the database
Public methodStatic memberUrl
Validate as an URL address.
Public methodStatic memberValues
Confirm that the value submitted is in a list of allowable values
Public methodStatic memberXss
Check if string could contain an XSS attack string
Top
See Also