Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • 2
    thanks for this but I tried this and even this returns nothing my form is still invalid, this is weird. I mean this code looks good but it doesn't make any sense why form.valid returns false Commented Jul 20, 2017 at 16:28
  • what does findInvalidControls() return you? Commented Jul 20, 2017 at 16:29
  • 1
    it returns nothing, invalid is empty. I checked one by one in debug watch screen, all the controls are valid but this.AddCustomerForm.valid still returns false. Commented Jul 21, 2017 at 15:01
  • 10
    @AngularInDepth.com - if the one of the controls is a form group, your function will return the invalid form group and not the specific form control which is invalid Commented Mar 8, 2018 at 14:04
  • 1
    i had the same issue, that my form was invalid but all fields where valid. I updated the field via field.setValue('1234', {onlySelf: true}). As soon as i remove onlySelf:true it was working as expected! Commented Nov 1, 2020 at 10:44