AngularJS validation patterns, syntax and properties. Validation of forms, controls, models using various angular validation directives.
Questions tagged [angularjs-validation]
145 questions
4
votes
2 answers
AngularJS form input name validation not working in ngrepeat
name="number-{{$index+1}}" working in ng-repeat at the same time myform.number-{{$index+1}}.$invalid does not working for the form
Demo: http://plnkr.co/edit/Z3EmpHu8w2iZcZko9dJv?p=preview
var app = angular.module('plunker',…

Mo.
- 26,306
- 36
- 159
- 225
4
votes
1 answer
Hide error labels shown with angularjs form validation after some time
I am using angularjs form validation for client side validation. I need to hide the labels which displaying with angularjs error form validation method, after 3 seconds, after message appear.
Html will look like this,
4
votes
2 answers
Prevent async unique validator to validate same value only when editing?
I've got an AngularJS form that has a custom validator to check with the server backend whether the input value is unique or not. The unique validation is done by the mob-async-validate-unique directive in the example below.
The form looks somewhat…

Dhiraj Gupta
- 9,704
- 8
- 49
- 54
4
votes
2 answers
conditional styling on Form Validation AngularJs
I have minlength, maxlength and required validation on…

Haseeb Mazhar Ranga
- 555
- 1
- 5
- 16
4
votes
3 answers
AngularJS form validation issues
I am trying to do a simple form validation using angular js. But it doesnt seems to work and I am not getting what I am missing.
HTML

Sumit
- 2,932
- 6
- 32
- 54
4
votes
3 answers
Angularjs validation behaves differently for 1.3.0 and 1.2.6
I wish to create a custom directive, which renders as an input type element. The directive should reuse the angularjs validation framework. Following is the custom-input directive in action which I have created:

Vaibhav
- 569
- 6
- 31
3
votes
1 answer
Angular Form Validation: $error.required set even when ng-required=false with custom input directive
I have Custom input component with validation with ngMessages,FormController and ng-required:

Radek Anuszewski
- 1,812
- 8
- 34
- 62
3
votes
0 answers
Validate dynamically created Check box and Radio buttons
I have an application in which dynamically check boxes and radio buttons get generated based on the data sent from the server. The number of check box/radio button displayed can increase up to 20 (in a single group).
My question is, what is the best…

Shashank HS
- 408
- 1
- 9
- 23
3
votes
1 answer
Validation on fields using index position
I have a couple of fields that I would like to replicate dynamically. I'm using ng-reapt which is doing the job. However, the validation messages are not working. Here's what I've got:
teste
…

Thiago Custodio
- 17,332
- 6
- 45
- 90
3
votes
3 answers
Why does adding additional AngularJS validation directives cause $asyncValidators to run multiple times?
Why does adding additional AngularJS validation directives cause $asyncValidators to run multiple times on page load?
I created a custom directive which implements $asyncValidators. This is the basic structure of that custom…

steampowered
- 11,809
- 12
- 78
- 98
3
votes
4 answers
Angularjs validation - bootstrap datepicker input is not recognized
If you read following Angularjs validations, you understand that:
Message will appear if user interacted and did not fill the date manually.
The problem is when date is filled using the datepicker the input is not recognized by Angularjs and still…

Abdulrahman Alsari
- 1,667
- 4
- 17
- 28
3
votes
2 answers
angularjs - not able to invalidate input (Object doesn't support property or method '$setValidity')
I try to do the following
if ($scope.RetypePassword != $scope.resource.Password) {
$scope.resource.Password.$setValidity("missmatch", false);
} else {
$scope.resource.Password.$setValidity("missmatch", true);
}
but fail with this…

Robert
- 2,357
- 4
- 25
- 46
3
votes
2 answers
Making and Angular form invalid when inputs aren't required
I'm making a profile editor directly on the user's profile page in where I want to show a live preview of the changes they are making.
I'm basically updating the view using models attached to inputs and textareas.
Here is a preview, showing name,…

Adrian Rodriguez
- 175
- 1
- 16
3
votes
2 answers
Reusing validation conditions in Angular
I like the granularity of Angular's form validation states, but it can get a little clunky when you have a form with lots of fields- even two fields start to make your markup a little soggy. Take the following example snippet:
3
votes
2 answers
checkbox unchecked to make form invalid
trying to add form validators for the checkbox in my form, in case if it's unchecked the form will have ng-invalid.

user2727195
- 7,122
- 17
- 70
- 118