Basic validator for input elements