NumericRule

A validation rule that demands that the validated field has a numeric value.

Type: Object

Show Example:
AngularJS
Knockout
jQuery

In this example, the 'numeric' rule is applied to the editor. This rule demands that the editor has a numeric value. To check this rule, specify a string in the editor.


                                    

                                    

In this example, the 'numeric' rule is applied to the editor. This rule demands that the editor has a numeric value. To check this rule, specify a string in the editor.


                                    

                                    

In this example, the 'numeric' rule is applied to the editor. This rule demands that the editor has a numeric value. To check this rule, specify a string in the editor.


                                    

                                    

message

Specifies the message that is shown for end-users if the current rule is broken.

Type: String
Default Value: 'Value should be a number'

You do not have to specify this field. In this instance, a default message will be shown. To include the name of the validated editor into the default validation message as a subject, set the name field of the dxValidator object.

If you assign an empty string to the message field, the message will not be shown.

type

Specifies the type of the current rule.

Type: String
Accepted Values: 'numeric'

Set this field to 'numeric' to define a rule that will be broken if the validated value is not numeric.