Form validation for the registration form