Soby Web Components

Numeric Validator

This example demonstrates how to use numeric validator in the Soby Validator.
"sobyValidate.GetValidator" method takes one parameter. The parameter is the type of the validator. This method returns the validator for the given type. "Validate" method of the validator, returns as invalid if the given value is not a numeric value. It returns as valid if the given value is a numeric value.

 sobyValidate.GetValidator(soby_ValidatorTypes.Numeric).Validate("32");
Output:true
sobyValidate.GetValidator(soby_ValidatorTypes.Numeric).Validate("t21");
Output:false
sobyValidate.GetValidator(soby_ValidatorTypes.Numeric).Validate("test");
Output:false

View source