Here’s an example project with a simple subclass of WebTextField called WebTextFieldValidated. It has an enumeration called States with the following values:
- Unvalidated
- Valid
- Invalid
And a State as States property.
This and many more features are built in to GraffitiTextField, and you’d probably greatly benefit from using that if you’re doing extended validation of data or simply want a lot more functionality with less work.