All Questions
Tagged with angular-validation angular
383 questions
2
votes
2
answers
112
views
Validator in not a function in angular
I have created own directive for adding validation and removing validation based input parameters of directive. I am getting error when loading and form field value changing validator is not working ...
0
votes
0
answers
128
views
How to prevent Angular form control from showing validation errors (red outline) on load in a reusable input component?
I’m working on an Angular form with a custom reusable input component that has required fields using Validators.required. When the page loads, the form controls are initially empty and marked as ...
1
vote
2
answers
74
views
Angular Template-Driven Form: Validate Password Field Only After User Interaction
I have a form:
<input
type="password"
id="password"
name="password"
ngModel
#password="ngModel"
...
1
vote
1
answer
147
views
How to use updateValueAndValidity()
I have two form controls as min and max. At the beginning min has a default value of 1 and max is empty. I want that max be always greater than min, so I defined a custom validator, which works nicely....
1
vote
2
answers
88
views
Angular - Custom form validator
I have two mandatory form controls as: minimumCharacters and maximumCharacters. I want to show an error, if the given maximumCharacters is smaller than the given minimumCharacters.
Here is how I have ...
1
vote
2
answers
96
views
Validation `Required` is not working with radiobtn when using ngFor in Reactive forms
I have a dynamic reactive angular form which builds forms and populates questions inside it dynamically according to questions types retrieved from the database. the problem is the required validation ...
1
vote
3
answers
164
views
Validation not working on fields name ending with dots in angular
I'm creating dynamic fields
<input class="form-control-lg form-control" placeholder="{{data.DisplayName}}" formControlName="{{data.labelName}}" type="text" ...
1
vote
1
answer
291
views
Angular Material - Chips with Email validation
I'm trying to create a form with an input using chips to send a message to various emails. I have it almost functional but I don't know how to properly show the message error when you write an invalid ...
1
vote
2
answers
628
views
Combining HTML and Angular reactive form validation
I'm building an Angular Reactive Form and I have an input of type number. I have provided Validators.min(0) to the FormControl, however when I focus the input and scrolls down or holds the Arrow down ...
0
votes
4
answers
1k
views
Get validators and values from angular FormControl
Is there a way for find out if an Angular FormControl has a validator and its value?
e.g. If I had a form control setup like this:
testControl: new FormControl(null, [Validators.required, Validators....
0
votes
2
answers
867
views
I've to disabled a FormControl but keep validation
I' ve this FormGroup:
this.fb.group({
a: ["", Validators.required],
b: ["", Validators.required],
c: [{value: "", disabled: true}, Validators.required]
});
...
1
vote
1
answer
292
views
Angular FormArray Input Reactive Form in Mat Table: required Validator works perfectly, but @rxweb/reactive-form-validators somehow not
The validator works perfectly with required. But I need the unique validator, to check if the labels has duplicate names.
When I switch to unique in inventory.component.ts the table isn't even showing ...
1
vote
2
answers
102
views
Angular Custom Validation Control doesn't get form value
This code in my form-validators.ts:
console.log('password:', password?.value);
console.log('confirmPwd:', confirmPwd?.value);
always fetched me undefined, causing the custom validation (...
-1
votes
3
answers
2k
views
Angular Reactive Form - Validation is not working in formGroup
I have this form group defined
get createItem(): FormGroup {
return this.formBuilder.group({
name: ['', Validators.required],
email: ['', Validators.required],
mobile: ['', ...
1
vote
1
answer
234
views
How to make this password match validation work
I have this code to check if both passwords match, however, it's not working as intended. I've tried what I've seen in some older questions but with no success.
I have this in my component's template:
...