[求助]如何判断提交form中的text.value与表aa的b字段的值相等,而不能提交
<%set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from cp"
rs.open sql,conn,1,3
%>
<script language="JavaScript">
<!--
function checkdata() {
if( addform.cpname.value =="") {
alert("\添加产品出错)
else if (addform.cpname.value == "<%=rs("name")%>")
alert("\添加产品出错,下面是产生错误的可能原因:\n\n·已有相同产品添加")
return false;
}
</script>
<form name="addform" method="post" action="cp_save.asp" onSubmit="return checkdata()">
sql="select * from cp"
rs.open sql,conn,1,3
%>
<script language="JavaScript">
<!--
function checkdata() {
if( addform.cpname.value =="") {
alert("\添加产品出错)
else if (addform.cpname.value == "<%=rs("name")%>")
alert("\添加产品出错,下面是产生错误的可能原因:\n\n·已有相同产品添加")
return false;
}
</script>
<form name="addform" method="post" action="cp_save.asp" onSubmit="return checkdata()">
我这样写,提交怎么不验证啊?
还望大侠指点,thank you,中秋快乐