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
Validating Against a Regular Expression
Another useful validation feature is the pattern attribute, which expects a Regular Expression as its value. A regular expression (regexp) is a pattern that can be used to match character combinations in text strings, so regexps are ideal for form validation and serve a variety of other uses in JavaScript.
Regexps are quite complex, and we don't intend to teach you them exhaustively in this ...