The following example shows how you can validate a number as an integer or real (floating point) number by setting the domain property on a NumberValidator instance.
Full code after the jump.
Continue reading ‘Validating integers using the NumberValidator class’
The following example shows how you can use the ZipCodeValidator to validate either US or Canadian zip codes (or should that be “postal codes” for our friends from the Great White North?). It turns out that making the ZipCodeValidator “Canadian friendly” is as simple as setting the domain property, and passing a constant value from the ZipCodeValidatorDomainType class (valid constants are US_ONLY and US_OR_CANADA).
Full code after the jump.
Continue reading ‘Using the ZipCodeValidator class to validate US or Canadian zip codes’