diff options
Diffstat (limited to 'src/app/vnfs/userlogin-form')
3 files changed, 6 insertions, 28 deletions
diff --git a/src/app/vnfs/userlogin-form/userlogin-form.component.css b/src/app/vnfs/userlogin-form/userlogin-form.component.css index 64db1d0..4df88b5 100644 --- a/src/app/vnfs/userlogin-form/userlogin-form.component.css +++ b/src/app/vnfs/userlogin-form/userlogin-form.component.css @@ -21,6 +21,7 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. ============LICENSE_END============================================ */ -.error-message { - color: red; -} +/* .error-msg{ + + color: red +} */
\ No newline at end of file diff --git a/src/app/vnfs/userlogin-form/userlogin-form.component.html b/src/app/vnfs/userlogin-form/userlogin-form.component.html index 605cb45..af58842 100644 --- a/src/app/vnfs/userlogin-form/userlogin-form.component.html +++ b/src/app/vnfs/userlogin-form/userlogin-form.component.html @@ -30,12 +30,10 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. <form #userForm="ngForm" (ngSubmit)="getData()"> <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> <input placeholder="Enter user Id" class="mdl-textfield__input" id="userId" required - [(ngModel)]="userId" name="userId" value="" #user="ngModel" (ngModelChange)="validateUserName()"> - <span class="error-message">{{errorMessage}}</span> + [(ngModel)]="userId" name="userId" value="" #user="ngModel"> </div> - <div class="form-group text-right"> - <button type="submit" [disabled]="invalid" + <button type="submit" [disabled]="!userForm.form.valid" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary"> Submit </button> diff --git a/src/app/vnfs/userlogin-form/userlogin-form.component.ts b/src/app/vnfs/userlogin-form/userlogin-form.component.ts index c62e9bb..188fe81 100644 --- a/src/app/vnfs/userlogin-form/userlogin-form.component.ts +++ b/src/app/vnfs/userlogin-form/userlogin-form.component.ts @@ -31,8 +31,6 @@ export class userloginFormComponent implements OnInit { userId: string = ''; returnUrl:string - invalid = true; - errorMessage = ''; constructor(private router: Router, private utiltiy: UtilityService, private route: ActivatedRoute ) { @@ -52,23 +50,4 @@ export class userloginFormComponent implements OnInit { this.router.navigateByUrl(this.returnUrl); } - validateUserName(){ - if (!this.userId.trim() || this.userId.length < 1) { - this.errorMessage = ''; - this.invalid = true; - }else if(this.userId.startsWith(' ') || this.userId.endsWith(' ')){ - this.errorMessage = 'Leading and trailing space is not allowed'; - this.invalid = true; - } else if(this.userId.includes(' ')){ - this.errorMessage = 'More than one space is not allowed in username'; - this.invalid = true; - } else if(this.userId.length > 50) { - this.errorMessage = 'Username should be of minimum one character and maximum 50 character'; - this.invalid = true; - }else { - this.invalid = false; - this.errorMessage = ''; - } - } - } |