(m.password.value) > 20 || len(m.password.value) < 5 || !isStr(m.password.value))
{
document.getElementById("passwordStr").style.display = "";
document.getElementById("password").style.background= "#FF0000";
document.getElementById("passwordStr").innerText = "对不起,密码必须为英文字母、数字或下划线,长度为5~20!";
}
else
{
document.getElementById("password").style.background= "#FFFFFF";
document.getElementById("passwordStr").style.display = "none";
}
}
function chkconfirmPassword()
{
var m=document.form1;
if (m.password.value != m.confirmPassword.value)
{
document.getElementById("confirmPasswordStr").style.display = "";
document.getElementById("confirmPassword").style.background= "#FF0000";
document.getElementById("confirmPasswordStr").innerText = "对不起,密码与重复密码不一致!";
}
else
{
document.getElementById("confirmPassword").style.background= "#FFFFFF";
document.getElementById("confirmPasswordStr").style.display = "none";
}
}
function checkfield()
{
var m=document.form1;
if(m.userName.value.length==0)
{
alert("对不起,用户名必须为英文字母、数字或下划线,长度为5~20。");
m.userName.focus();
return false;
}
if(m.password.value.length==0)
{
alert("对不起,密码必须为英文字母、数字或下划线,长度为5~20。");
m.password.focus();
return false;
}
if (m.password.value != m.confirmPassword.value)
{
alert("对不起,密码与重复密码不一致!");
m.confirmPassword.focus();
return false;
}
if(m.comNm.value.length==0)
{
alert("对不起,企业名称不能为空!!");
m.comNm.focus();
return false;
}
m.submit();
}
//-->
</script>
<body topmargin="0">
<form name="form1" method="post" action="/Control?act=Register">
<table width="100%">
<tr><td align="center"> <H2>Ajax 演示
程序</H1></td></tr>
<tr><td align="center"> ------ 企业注册 By Alpha</td></tr>
</table>
<HR>
<table width="400" border="0" cellpadding="1" cellspacing="1" align="center" >
<tr>
<td><font color="red">*</font></td>
<td>用户帐号:</td>
<td>
<input type="text" name="userName" maxlength="20" style="background:#FFFFFF" onBlur="chkUser()" value=""/>
<div id="showStr" style="background-color:#FF9900;display:none"></div>
</td>
</tr>
<tr>
<td><font color="red">*</font></td>
<td>企业名称:</td>
<td>
<input type="text" name="comNm" maxlength="100" style="background:#FFFFFF" onBlur="chkComNm()" value=""/>
<div id="comNmStr" style="background-color:#FF9900;display:none"></div>
</td>
</tr>
<tr>
<td><font color="red">*</font></td>
<td>用户密码:</td>
<td><input type="password" name="password" maxlength="20" style="background:#FFFFFF" onBlur="chkpassword()"/>
<div