diff --git a/client/src/app/shared/forms/form-reactive.ts b/client/src/app/shared/forms/form-reactive.ts index 1e8a69771..a5732e083 100644 --- a/client/src/app/shared/forms/form-reactive.ts +++ b/client/src/app/shared/forms/form-reactive.ts @@ -21,4 +21,20 @@ export abstract class FormReactive { } } } + + // Same as onValueChanged but force checking even if the field is not dirty + protected forceCheck() { + for (const field in this.formErrors) { + // clear previous error message (if any) + this.formErrors[field] = ''; + const control = this.form.get(field); + + if (control && !control.valid) { + const messages = this.validationMessages[field]; + for (const key in control.errors) { + this.formErrors[field] += messages[key] + ' '; + } + } + } + } } diff --git a/client/src/app/videos/video-add/video-add.component.html b/client/src/app/videos/video-add/video-add.component.html index 14c7a0136..b6be0d782 100644 --- a/client/src/app/videos/video-add/video-add.component.html +++ b/client/src/app/videos/video-add/video-add.component.html @@ -15,7 +15,7 @@
- + (press enter to add the tag)
+
+ {{ tagsError }} +
+
@@ -39,6 +43,7 @@
@@ -50,6 +55,10 @@ +
+ {{ fileError }} +
+