Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
27 views1 page

Review - Form Validation - Codecademy

The document outlines the importance of client-side validation in forms, which occurs in the browser before data is sent to the server. It details various attributes such as 'required', 'min', 'max', 'minlength', 'maxlength', and 'pattern' that can be used to validate user input. These validations provide immediate feedback to users, ensuring data accuracy and safety before submission.

Uploaded by

rajjrrathore
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

Review - Form Validation - Codecademy

The document outlines the importance of client-side validation in forms, which occurs in the browser before data is sent to the server. It details various attributes such as 'required', 'min', 'max', 'minlength', 'maxlength', and 'pattern' that can be used to validate user input. These validations provide immediate feedback to users, ensuring data accuracy and safety before submission.

Uploaded by

rajjrrathore
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Awesome job adding client-side validation to <form> s!

Let’s quickly recap:

Client-side validations happen in the browser before information is sent to a server.

Adding the required attribute to an input related element will validate that the input field has
information in it.

Assigning a value to the min attribute of a number input element will validate an acceptable minimum
value.

Assigning a value to the max attribute of a number input element will validate an acceptable
maximum value.

Assigning a value to the minlength attribute of a text input element will validate an acceptable
minimum number of characters.

Assigning a value to the maxlength attribute of a text input element will validate an acceptable
maximum number of characters.

Assigning a regex to pattern matches the input to the provided regex.

If validations on a <form> do not pass, the user gets a message explaining why and the <form> cannot
be submitted.

These quick checks help ensure that input data is correct and safe for our servers. It also helps give users
immediate feedback on what they need to fix instead of having to wait for a server to send back that
information.

You might also like