diff --git a/src/app/child-dev-project/children/child-details/child-details.component.ts b/src/app/child-dev-project/children/child-details/child-details.component.ts index 2d82f42628..19162649dc 100644 --- a/src/app/child-dev-project/children/child-details/child-details.component.ts +++ b/src/app/child-dev-project/children/child-details/child-details.component.ts @@ -193,7 +193,10 @@ export class ChildDetailsComponent implements OnInit { } save() { + // errors regarding invalid fields wont be displayed unless marked as touched + this.form.markAllAsTouched(); this.validateForm = true; + if (this.form.valid) { this.assignFormValuesToChild(this.child, this.form); @@ -214,7 +217,9 @@ export class ChildDetailsComponent implements OnInit { ); } else { const invalidFields = this.getInvalidFields(this.form); - this.alertService.addDanger("Form invalid, required fields missing"); + this.alertService.addDanger( + "Form invalid, required fields (" + invalidFields + ") missing" + ); } }