form validation for the register page