Takes an input from the form and validates it