User Form
Notes
- I added the novalidate attribute to the form because without it, you may see some of the built-in HTML5 appear with the email textbox (I did, at least)
- When you submit the form without checking the checkbox, it will not be included in the data submitted.
- Set the web developer tools to 'Preserve Log' because if you have an error in your valiation code, then the form will submit (and clear out the console log)
Requirements
-
First Name
-
If the first name not entered, the error message displayed to the user should be: Please enter your first name
-
If the first name is longer than 30 characters, the error message displayed to the user should be: First name cannot more than 30 characters
-
Last Name
-
If the last name not entered, the error message displayed to the user should be: Please enter your last name
-
If the last name is longer than 30 characters, the error message displayed to the user should be: Last name cannot more than 30 characters
-
Email
-
If the email is not entered, the error message displayed to the user should be: Please enter your email address
-
If the email entered does not match the pattern for a valid email address, the error message displayed to the user should be: The email entered is not a valid email address
-
If the last name is longer than 100 characters, the error message displayed to the user should be: Email address cannot more than 100 characters
-
Password
-
If the password is not entered, the error message displayed to the user should be: Please enter a password
-
Role
-
If the role selected is not either 'Admin' or 'Standard User', the error message displayed to the user should be: Please select a role