Validation and JavaScript

The JavaScript side of the story

Although validation attributes help you in many situations, in complex systems you cannot avoid writing your own JavaScript validation code or using a validation framework. Browsers apply form validation only when you click a submit button. Great web applications with enhanced user experience validate fields as soon as you leave them, or sometimes as you type. In these situations, you cannot only leverage validation attributes, you also need to create a custom validation code. When the validation logic does not fit into the frame provided by the validation attributes, you fall back to writing JavaScript. NOTE: Custom validation is a complex topic and often bound to server-side frameworks.

Get hands-on with 1200+ tech skills courses.