Friday, June 6, 2014

Angular.js: Form validation

Just a quick tip before the weekend. Angular.js provides validation through some of the well known HTML5 validation attributes like required, pattern, minlength, maxlength, min, max. However when your browser supports HTML5, the build-in validation will kick in, giving you no chance to integrate with Angular.js (to restyle or localize your validation messages for example).

To prevent HTML5  validation, it’s necessary to add the novalidate attribute to your form:

<form name="form" class="css-form" novalidate>

No comments: