Soby Web Components

Exclusion 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 contained by ExcludedValues. It returns as valid if the given value is not contained by ExcludedValues.

 var exclusionValidator = sobyValidate.GetValidator(soby_ValidatorTypes.Exclusion);
 exclusionValidator.ExcludedValues = ["london", "tokyo", "paris"];
 exclusionValidator.Validate("london");
Output:false
exclusionValidator.Validate("istanbul");
Output:true
View source