validate the form fields