HTML Form Validation Flashcards

1
Q

Required Attribute

A

Fields in our forms which are not optional

Ex:

<input type=”–” required”>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Text Length

A

Attributes:
minlength & maxlength

Ex:

<input></input>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Pattern

A

For cases when we want user input to follow specific guidelines, we use the pattern attribute and assign it a regular expression, or regex. Regular expressions are a sequence of characters that make up a search pattern. If the input matches the regex, the form can be submitted.

Ex:

<input type=”number” pattern=”[0-9] {14, 16}”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly