From f53d910f8e4c7e69f417a6463bf848857b99e7ad Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sat, 10 Jul 2021 16:59:46 +0200 Subject: [PATCH] clear the warnings after input changes --- src/components/coaches/CoachForm.vue | 35 ++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/components/coaches/CoachForm.vue b/src/components/coaches/CoachForm.vue index e115312..79c0236 100644 --- a/src/components/coaches/CoachForm.vue +++ b/src/components/coaches/CoachForm.vue @@ -2,12 +2,22 @@
- +

Firstname must not be empty.

- +

Lastname must not be empty.

@@ -16,12 +26,18 @@ id="description" rows="5" v-model.trim="description.val" + @blur="clearValidity('description')" >

Description must not be empty.

- +

Rate must be greater than 0.

@@ -32,6 +48,7 @@ id="backend" value="backend" v-model="areas.val" + @blur="clearValidity('areas')" />
@@ -41,11 +58,18 @@ id="frontend" value="frontend" v-model="areas.val" + @blur="clearValidity('areas')" />
- +

At least one expertise must be selected.

@@ -88,6 +112,9 @@ export default { }; }, methods: { + clearValidity(input) { + this[input].isValid = true; + }, validateForm() { this.formIsValid = true; if (this.firstName.val === '') {