Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
- Client-side form validation
- Using Built-in Form Validation
- The Required Attribute
- Validating Against a Regular Expression
- Constraining the Length of Your Entries
- Full Example
- The Constraint Validation API
- Implementing a Customized Error Message
- A More Detailed Example
- Validating Forms Without a Built-in API
- Form Validation Quiz 6 questions
Well done!
You have completed (UPI) Chapter 10: Utilizing Forms with JavaScript!
Instruction
The Required Attribute
The simplest HTML validation feature is the required attribute. To make an input mandatory, add this attribute to the element. When this attribute is set, the element matches the :required UI pseudo-class and the form won't submit, displaying an error message on submission when the input is empty. While empty, the input will also be considered invalid, matching the :invalid UI pseudo-class.
...