Validates the field and sets the invalid property based on the result.
invalid
The method fires a validated event with the result of the validation.
validated