I am using the angular form, I want value of only valid fields in the form, here in picture mailing_zipcode field is invalid, so I want to discard that value, is there any way to do this?
I am using the angular form, I want value of only valid fields in the form, here in picture mailing_zipcode field is invalid, so I want to discard that value, is there any way to do this?
You could use a reactive form and check the validation status of every element, like I do check here the name validation status: https://stackblitz.com/edit/angular-ztjgg8?devtoolsheight=33&file=src/app/reactive/hero-form-reactive.component.ts
Afterwards you transfer your input data to da data object which you would sent do the server.