Hi Guest 1 HomePage 1 Jobs 1 WalkIn 1Articles  

 :) Latest Topic
Numbers And Strings
Objects And Array
AngularJS VS JavaScript
Controllers in Files
Load the Library
AngularJS Directives
Repeating Directive
AngularJS Facts
Create Directives
Restrict Directive
Custom Filter
AngularJS Services
AngularJS Service 2
AngularJS Tables
Select Option
Select Option 2
AngularJS Forms
Form Validation
Validation CSS
Validation Example
AngularJS API
AngularJS $http
AngularJS Database
AngularJS HTML DOM
AngularJS Events
Custom Validation
AngularJS Tutorial
AngularJS Introduction
Angular init Directive
AngularJS Expressions 1
AngularJS Applications
AngularJS Expressions 2
Angular CSS Properties
AngularJS JSON
AngularJS Modules
Controller Basic
Add a Directive
Model Directive
Validate Inputs
CSS Classes
Data Binding
AngularJS Controller
AngularJS Scope
Root of Scope
AngularJS Filters
 


  

 
Validation CSS
Question Posted on 23 Apr 2020

Home >> Tutorial >> AngularJS >> Validation CSS


Validation CSS
AngularJS helps to add CSS classes to forms and input fields depending on there states. Below are the classes are added to or removed from input fields. Below are the list of different states as given belows:-
(1)ng-untouched When field has not been touched yet
(2)ng-touched When field has been touched
(3)ng-pristine When field has not been modified yet
(4)ng-dirty When field has been modified
(5)ng-valid when field content is valid
(6)ng-invalid When field content is not valid
(7)ng-valid-key key for each validation. Example: ng-valid-required, useful when there are more than one thing that must be validated
(8)ng-invalid-key when ng-invalid-required is required

Below are different classes are added or removed from forms:-
(1)ng-pristine When No fields has not been modified yet
(2)ng-dirty When One or more fields has been modified
(3)ng-valid When form content is valid
(4)ng-invalid When form content is not valid
(5)ng-valid-key One key for each validation. Example: ng-valid-required, useful when there are more than one thing that must be validated
(6)ng-invalid-key Example: ng-invalid-required

Classes are removed if value they represent is false.

Below is the example to use CSS on input textbox with example:-


ANgularJS Validation CSS
Below is one more example which is form based:-

ANgularJS Validation CSS2





Other Important Questions
Numbers And Strings
Objects And Array
AngularJS VS JavaScript
Controllers in Files
Load the Library







 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |