set validator for input field