I created a registration form where users are able to sign up.
- First Name
- Last Name
- Password
- Role
- The first name cannot be empty.
- The email must be a valid email address and can't be empty. A function called
validateEmail
has already been provided for you to check if the email is valid. It returnstrue
if the email is valid, otherwisefalse
is returned. - The password must be at least 8 characters long.
- The role must be either individual or business.
- The form shows an error message if the password is less than 8 characters long.
Lastly, the form clears after a successful submission.