Added validation to the registration form.