floatLabelType="Always"
formControlName="scReportedBy"
placeholder="reportedBy"
[class.e-error]="getClass('scReportedBy')">
public getClass(valid) {
if (this.servicecallForm.controls[valid].valid) {
return false;
} else {
return true;
}
}
.e-float-input.e-control-wrapper:not(.e-error) input:valid ~ label.e-float-text, .e-float-input.e-control-wrapper:not(.e-error) input ~ label.e-label-top.e-float-text {
color:red;
}
|
Hi,
My requirement is am having 3 ejs text box,
Current password, new password and confirm password need to apply validation for the ejs textboxes
Validation rules minimum 8 characters max 50 characters, contains 3 out of 4 types of characters:
These below regex needs to display individually when requirements mets its should tick on circle
Lowercase,uppercase,symbol,number
Once the requirements mets it should tick of on circle
It should present asterix when characters are entered on screen and eye button in ejs textbox and when toggling its show password to see actual password I want solution in angular syncfusion cross field custom validation using angular reactive form with ejs text box . need to display validation error on ejs text box
Hi Rocky,
As per your requirement we are prepared the sample. In that we have validated as per requirement like Validation rules minimum 8 characters max 50 characters, contains 3 out of 4 types of characters: Lowercase, uppercase, symbol, number. Once the requirements meet tick of on circle and when toggling its show password to see actual password. We have attached the sample for your reference.
<div class="form-group template"> <div class="e-float-input" [ngClass]="{ 'e-success': username.valid }"> <ejs-textbox floatLabelType="Auto" type="password" #default id="current_password" name="username" placeholder="Enter your Password" floatLabelType="Auto" [(ngModel)]="UserDetails.username" #username="ngModel" minlength="8" maxlength="50" required pattern="^((?=.*?[A-Z])(?=.*?[a-z])(?=.*?\d)|(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[^a-zA-Z0-9])|(?=.*?[A-Z])(?=.*?\d)(?=.*?[^a-zA-Z0-9])|(?=.*?[a-z])(?=.*?\d)(?=.*?[^a-zA-Z0-9])).{8,}$"></ejs-textbox> <!-- <span class="e-icons e-eye"></span> --> <span class="e-float-line"></span> <label class="e-float-text" [ngClass]="{ 'e-label-top': UserDetails.username !== '', 'e-label-bottom': UserDetails.username == '' }" for="name"></label> </div> <span class="e-success" id="icon" *ngIf="username.valid" class="e-icons e-circle-check"></span> <span class="e-error" *ngIf=" username.errors && username.errors.required && (username.dirty || username.touched) "> * Enter current Password </span> <span class="e-error" *ngIf=" username.errors && username.errors.pattern && (username.dirty || username.touched) "> * Enter a valid current password </span> |
Sample : https://stackblitz.com/edit/angular-btmnax-vgihnh?file=app.component.ts
Regards,
Mohanraj M
Hi mohan , thank u actually my requirement is using angular reactive form I have mentioned it in previous query . I need solution using angular reactive form cross field custom validation
Hi Vinitha,
Thank you for your response , am waiting for the same , and that eye icon should be slash eye icon when we click that eye icon its should slash, and the characters are entered on screen as asterisks , not dotted .
Hi vinitha ,
Thanks for your update, actually my requirements is I want this whole solutions using angular reactive form using ejs textbox cross field validation .. Not using template driven
Regards,