Class ValidationOpts
Common validation options that can be specified for all validation methods.
Inheritance
Namespace: DataTables
Assembly: DataTables-Editor-Server.dll
Syntax
public class ValidationOpts : object
Fields
| Improve this Doc View SourceEmpty
Allow a field to be empty, i.e. a zero length string -
''
(true
- default) or require it to be non-zero length (false
).
Declaration
public bool? Empty
Field Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
Message
Error message should the validation fail
Declaration
public string Message
Field Value
Type | Description |
---|---|
System.String |
Optional
Require the field to be submitted (false
) or not
(true
- default). When set to true
the field does not need to be
included in the list of parameters sent by the client - if set to false
then it must be included. This option can be particularly useful in Editor
as Editor will not set a value for fields which have not been submitted -
giving the ability to submit just a partial list of options.
Declaration
public bool Optional
Field Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceSelect(ValidationOpts)
Check to see if validation options have been given. If not, create and instance with the default options and return that. This is useful for checking to see if a user has passed in validation options or not, since a new instance can't be a default parameter value.
Declaration
public static ValidationOpts Select(ValidationOpts user)
Parameters
Type | Name | Description |
---|---|---|
ValidationOpts | user | User set validation options or null |
Returns
Type | Description |
---|---|
ValidationOpts | Validation options to use for the validation |