郁闷问题!ASP页提交表单时执行不了Javascript判断!
<script language="javascript" type="text/javascript"> function judge()
{
if (document.form1.userpwd1.value=="")
{alert("请输入你的密码");
document.form1.userpwd1.focus()
document.form1.userpwd1.select()
return false;}
if (document.form1.userpwd2.value!=document.form1.userpwd1.value)
{alert("两次输入密码不一致,请重新输入");
document.form1.userpwd1.focus()
document.form1.userpwd1.select()
return false;}
if (document.form1.userpwd1.value.length<4||document.form1.userpwd1.value.length>8)
{alert("请输入4-8位的密码");
document.form1.userpwd1.focus()
document.form1.userpwd1.select()
return false;}
if (document.form1.nickname.value=="")
{alert("请输入你的昵称");
document.form1.nickname.focus()
document.form1.nickname.select()
return false;}
var regx=/^\d{5,9}$/;
if(!regx.test(document.form1.qq.value))
{alert("请输入你正确的QQ号");
document.form1.qq.focus()
document.form1.qq.select()
return false;}
}
</script>
<%
userid=session("userid")
userpwd1=session("userpwd1")
set myconn=Server.CreateObject("ADODB.Connection")
myconn.open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = "&server.Mappath("user.mdb")
set rs=server.CreateObject("ADODB.RecordSet")
rs.open "select * from [user] where userid='"&userid&"' ",myconn,1,1
nickname=rs("nickname")
qq=rs("qq")
rs.close
end if
%>
<form id="form1" name="form1" method="post" oXsubmit="reXurn judge()" action="xgzl_cl.asp" > <--屏蔽了 ..只能用"oXsubmit="retXurn judge()" 代替" 大家都明白!提交时激发judge()函数-->
新密码:<input name="userpwd1" type="text" class="heng" >
确认新密码:<input name="userpwd2" type="text" class="heng" >
昵称:<input name="nickname" type="text" class="heng" value=<% =server.htmlencode (nickname)%>>
QQ:<input name="qq" type="text" class="heng" value= <% =server.htmlencode (qq)%> >
<input name="Submit" type="submit" class="loginbutton" value="提交" >
</form>
我也不知道那点错子 看着都正确啊! 就是执行不了judge()函数进行不了判断!而在别的页面,同样的方法却能判断!郁闷 高手看看那里的问题,给指点一下,谢谢!