username:
password:
var mesEnglish = {
userNameNull:'Sorry,Username is null',
userNameInput:'Please input your username',
passWordNull:'Sorry,Password is null',
passWordInput:'Please input your password'
};
var mesChinese = {
userNameNull:'对不起,用户名不能为空',
userNameInput:'请输入用户名',
passWordNull:'对不起,密码不能为空',
passWordInput:'请输入密码'
};
var mes = {};
var type=navigator.appName;
if (type=="Netscape"){
var languagetype = !!navigator.languages?navigator.languages[0]:navigator.language;
var lang = languagetype.substr(0,2);
}else{
var lang = navigator.userLanguages[0].substr(0,2);
}
if (lang == "en"){
mes = mesEnglish;
}else if(lang == "zh"){
mes = mesChinese;
}else{
mes = mesEnglish;
}
var username=document.getElementsByTagName("input")[0];
var password=document.getElementsByTagName("input")[1];
var username_p=document.getElementById("username_Tips");
var password_p=document.getElementById("password_Tips");
username.οnblur=function(){
if(username.value.length==0){
username_p.innerHTML=mes.userNameNull;
}else{
username_p.innerHTML="";
}
}
username.οnkeyup=function(){
if(username.value.length==0){
username_p.innerHTML=mes.userNameInput;
}else{
username_p.innerHTML="";
}
}
password.οnblur=function(){
if(password.value.length==0 ){
password_p.innerHTML=mes.passWordNull;
}else{
password_p.innerHTML="";
}
}
password.οnkeyup=function(){
if(password.value.length==0 ){
password_p.innerHTML=mes.passWordInput;
}else{
password_p.innerHTML="";
}
}