update form validation

This commit is contained in:
Chneemann 2024-05-25 18:16:41 +02:00
parent 6086d41474
commit 8c314bff50
6 changed files with 16 additions and 3 deletions

View file

@ -121,7 +121,7 @@
}
</div>
<div class="btns">
@if (currentUserId !== firebaseService.getCurrentUserId()){
@if (currentUserId){
<app-form-btn
class="btn-delete"
type="button"

View file

@ -24,6 +24,7 @@
class="custom-input"
autocomplete="new-password"
[(ngModel)]="pwResetData.password"
pattern="[^<>]*"
required
/>
@if(!pwResetData.password) {
@ -56,6 +57,7 @@
class="custom-input"
autocomplete="new-password"
[(ngModel)]="pwResetData.passwordConfirm"
pattern="[^<>]*"
required
/>
@if(!pwResetData.passwordConfirm) {

View file

@ -53,6 +53,7 @@
placeholder="{{ 'login.password' | translate }}"
class="custom-input"
autocomplete="current-password"
pattern="[^<>]*"
[(ngModel)]="loginData.password"
required
/>

View file

@ -21,10 +21,12 @@
id="name"
name="name"
#name="ngModel"
maxlength="20"
placeholder="{{ 'register.name' | translate }}"
class="custom-input"
autocomplete="name"
[(ngModel)]="registerData.name"
pattern="[A-Za-z ]+"
required
/>
@if(!registerData.name) {
@ -37,9 +39,13 @@
<img class="custom-img" alt="" />
}
<div class="error-msg">
@if (!name.valid && name.touched && !sharedService.isBtnDisabled) {
@if (name.hasError('pattern') && name.touched &&
!sharedService.isBtnDisabled) {
<p>{{ "register.errorPattern" | translate }}</p>
} @else { @if (!name.valid && name.touched &&
!sharedService.isBtnDisabled) {
<p>{{ "register.errorName" | translate }}</p>
}
}}
</div>
<input
type="mail"
@ -86,6 +92,7 @@
class="custom-input"
autocomplete="new-password"
[(ngModel)]="registerData.password"
pattern="[^<>]*"
required
/>
@if(!registerData.password) {
@ -120,6 +127,7 @@
class="custom-input"
autocomplete="new-password"
[(ngModel)]="registerData.passwordConfirm"
pattern="[^<>]*"
required
/>
@if(!registerData.passwordConfirm) {

View file

@ -35,6 +35,7 @@
"privacyPolicy0": "Ich akzeptiere die",
"privacyPolicy1": "Datenschutzerklärung",
"privacyPolicyError": "Sie müssen die Datenschutzbestimmungen akzeptieren!",
"errorPattern": "Bitte nur Buchstaben und Leerzeichen verwenden!",
"errorName": "Sie müssen einen Namen eingeben!",
"errorMail0": "Sie müssen eine E-Mail Adresse eingeben!",
"errorMail1": "Dies ist kein gültiges E-Mail-Format!",

View file

@ -35,6 +35,7 @@
"privacyPolicy0": "I accept the",
"privacyPolicy1": "Privacy policy",
"privacyPolicyError": "You must accept the privacy policy!",
"errorPattern": "Please use only letters and spaces!",
"errorName": "You must enter a name!",
"errorMail0": "You must enter a mail!",
"errorMail1": "This is not a valid email format!",