看看这段网页代码!(javascript)

来源:百度知道 编辑:UC知道 时间:2024/05/24 22:40:49
if(name_main.length==0)
{
alert("输入有错误!用户名不能为空!");
}
else if(password_main.length<6)
{
alert("输入有错误!您输入的密码不能小于6位!");
}
else if(password_main.indexOf("*",0)==0)
{
alert("输入有错误!您输入的密码不能包含*!");
}
else if(password_main.indexOf("''",0)==0)
{
alert("输入有错误!您输入的密码不能包含''!");
}
else if(password_main2!=password_main)
{
alert("输入有错误!您输入的用户名不相等!");
}
else if(question_main.length==0)
{
alert("输入有错误!您输入的密码问题为空!");
}
else if(result_main.length==0)
{
alert("输入有错误!您输入的密码答案为空!");
}
else if(email_main.indexOf("@",0)==-1)
{
alert("输入有错误!您输入的邮箱地址必须包括@!");
}
else if(email_main.indexOf(".",0)==-1)
{
alert("输入有错误!您输入的邮箱地址必须包括.!");
}
else if(document.form1.sex[0].checked==1)
{
s

不允许这样写,
你可以在页面上加个<Div ID="cs"></DIV>,判断内容如下:

else
{
cs.innerHTML = "你要显示的内容";
}
或者直接
else
{
alert("你要显示的内容");
}