回 帖 发 新 帖 刷新版面

主题:验证码出错,在线等?

<script>
function addok()
{var yz=add.yz.value;
var yzm=add.yzm.value;

  if(yz=="")
 {alert("验证码不能为空!");
 return false;
 }
   if(yz!=yzm)
 {alert("验证码不正确");
 return false;
 }
return true;
}

</script>

验证码:
<input name="yz" type="text" id="yz"  size="10" />
<input name="yzm" type="hidden" id="yzm" value="<%=Session("GetCode")%>" />                      
图案:<img src="getcode.asp" border="0" />

<input type="submit" value="回复留言" onclick="return addok()"/>

yzm要比yz慢一次啊,把yzm放在下面也不行啊,

回复列表 (共3个回复)

沙发

怎么没人知道吗?

板凳

不可能出错,除非你的验证码有错,Session没清空过.

3 楼

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="style.css">
<title></title>
</head>
<script>
function addok()
{var yz=add.yz.value;
var yzm=add.yzm.value;
 if(add.name.value=="")
 {alert("昵称不能为空!");
 return false;
 }
 if(add.content.value=="")
 {alert("回复内容不能为空!");
 return false;
 }
  if(yz=="")
 {alert("验证码不能为空!");
 return false;
 }
  if(yz!=yzm)
 {alert("验证码不正确!");
 return false;
 }
return true;
}

</script>
<body>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <!--DWLayoutTable-->

          <tr>
            <td height="223" valign="top"><form name="add" action="recheck.asp" method="post" >
<table width="100%" border="0" cellpadding="0" cellspacing="0">
              <!--DWLayoutTable-->

              <tr><td ><div align="right">昵 称:</div></td>
                      <td colspan="2" valign="top" ><input name="name" type="text" id="name" size="45"  value="<%=session("bbsuser")%>"/></td>
                    </tr>
              <tr><td ><div align="right">验证码:</div></td>
                      <td ><input name="yz" type="text" id="yz" size="10" />
                      <input name="yzm" type="hidden"  value="<%=session("getcode")%>" />
                      图案:<img  src="getcode.asp" border="0" /></td>
   
                    </tr>

       
              <tr><td ><div align="right">内 容:</div></td></tr>
              <tr><td colspan="2" align="center"><input type="submit" value="回复留言" onclick="return addok()"/></td></tr>

</table>

</body>
</html>

我来回复

您尚未登录,请登录后再回复。点此登录或注册