consolidated the checkValidity functions on typeahead inputs