Js to determine whether the text box is empty. For more information, see.
The Code is as follows:
// The user name is not empty for verification
Function checkUserName (){
Var name = document.myform.txt User; // here I think: name represents the text box of txtUser
If (name. value. length = 0 ){
Alert ("Enter the user name ");
Name. focus ();
Return false;
} Else {return true ;}
}
// Non-empty password verification + Validation
Function checkPass (){
Var passmediadocument.myform.txt Pass;
Var rpass#document.myform.txt RPass;
If (pass. value = ""){
Alert ("the password cannot be blank ");
Pass. focus ();
Return false;
} Else if (pass. value. length <4 | pass. value. length> 16 ){
Alert ("the password must be 4-16 characters long ");
Pass. select ();
Return false;
} Else if (rpass. value! = Pass. value ){
Alert ("confirming that the password is inconsistent with the password ");
Rpass. select ();
Return false;
} Else {return true ;}
}