Easily validate a form element against a set of rules.