Angular2 form validation problem

clipboard.png

< H2 > ask how to judge how to change the color of the login button after entering content in two input boxes at the same time < / H2 >
Mar.20,2021

you can judge by the value of these two input. If both value are not empty, let the disabled attribute of button be false, otherwise true


<input [(ngModel)]="name" (ngModelChange)="onchange()"/>
<input [(ngModel)]="pwd" (ngModelChange)="onchange()"/>
<button [disable]="isDisable" (click)="onLogin()"></button>

isDisable=true;
name='';
pwd='';
onchange(){
    if(name.length>0&&pwd.length>0){
        this.isDisable=false;
    }else{
        this.isDisable=true;
    }
}

style when writing CSS to control whether Button is available

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35ad2-2bfbd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35ad2-2bfbd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?