Form Validations: HTML 5 & JavaScript

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/11

encourage image

There's no tags or description

Looks like no tags are added yet.

12 Terms

1
New cards

●Forms introduce essential HTML elements including

○tags

○attributes

○structure


2
New cards

Form validation helps

prevent malicious users from submitting harmful data or code.

3
New cards

●HTML5 has built in validation attributes.

ensures the user must fill in this field

required


4
New cards

defines the minimum and maximum acceptable values 

min and max


5
New cards

sets the maximum number of characters

maxlength


6
New cards

Uses regex to define a specific input format

pattern


7
New cards

Input types attribute changes (text, email, number, password, date, tel)

how browser validates and displays the input.

○text: No built-in validation

○email: checks for @ and domain

○number: Restricts to digits, allows min/max

○password: Masks text

○date: validates format

○tel: No strict validation but hints to mobile devices.


8
New cards

displays gray hint text

placeholder

9
New cards

Makes field not editable and unsubmittable

disabled

10
New cards

●Makes a field not editable but can still be submitted

readonly

11
New cards

JavaScript form validation does what

●checks user input before submitting the form to ensure it's correct. It helps catch errors and improves the user experience.

12
New cards

●You could validate forms in Javascript used two approaches

○Using Conditional Logic: which involves if-else conditions to validate input

○Using Regular Expressions (Regex): A more advanced approach where patterns are matched for validating inputs such as emails, passwords and usernames.