This is the header for the Week 10's Notes.

≪ Go Back to Portal

The Notes:

Validating Forms - MDN:

Client-side form validation is an initial check and an important feature of good user experience: by catching invalid data on the client-side, the user can fix it straight away. If it gets to the server and is then rejected, a noticeable delay is caused by a round trip to just tell the user to fix their data.

It should not, however, be your only security measure; your apps should be checked for security on both the server-side and the client-side. This is because malicious users can still send bad data to your servers, as client-side validations can be all too easily bypassed.

Warning: Never trust data passed to your server from the client. Even if your form is validating correctly and preventing malformed input on the client-side, a malicious user can still alter the network request.

Built-in Form validation (HTML):

Not as customizable as JavaScript validation, but has generally better performance.

Things include:

JavaScript Validation:

The Constraint Validation API support consists of a set of methods and properties available on the following form element DOM interfaces:

The Constraint Validation API makes the following properties available on the above elements:

The Constraint Validation API also makes the following methods available on the above elements and the form element:

Fetch API:

This has been reviewed in WDD 230 and on personal studies.