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
A More Detailed Example
Now that we've seen a really simple example, let's see how we can use this API to build some slightly more complex custom validation.
First, the HTML. Again, feel free to build this along with us:
<form novalidate>
<p>
<label for="mail">
<span>Please enter an email address:</span>
<input type="email" id="mail" name="mail" required minlength="8" />
<sp...