谢谢islet大哥!!!
我参照你的代码改了一下,但是打开时网页是空白的,也没有任何错误提示,请你帮我检查一下错误好吗?
<script language="javaScript">
function ff(obj,id){
if(obj.checked==true)
{alert("添加此产品!");}
<%set rs1=server.CreateObject("adodb.recordset")
sql1 = "select * from kucun where kcid="+id
rs1.Open sql1,conn,1,1
set rs2=server.CreateObject("adodb.recordset")
sql2 = "select * from jiage"
rs2.Open sql2,conn,1,3
rs2.AddNew
rs2("ph")=rs1("ph")
rs2("chd")=rs1("chd")
rs2("zhlbsh")=rs1("zhlbsh")
rs2("jsh")=rs1("jsh")
rs2("gdzl")=rs1("gdzl")
rs2("gbzl")=rs1("gbzl")
rs2("dw")=rs1("dw")
rs2("kcno")=rs1("kcno")
rs2.Update
rs2.Close
set rs2=nothing%>
else
{
if(confirm("您真的要删除产品吗?"))
<%
set rs1=server.CreateObject("adodb.recordset")
sql1 = "select * from kucun where kcid="+id
rs1.Open sql1,conn,1,1
kcno=rs1("kcno")
set rs2=server.CreateObject("adodb.recordset")
sql2 = "delet from jiage where kcno='"&kcno&"'"
rs2.Open sql2,conn,1,1
rs2.Close
set rs2=nothing%>
else
obj.checked=true;}
}
</script>
......
<input type="checkbox" name="xd" value="<%=rs("kcid")%>" onClick="ff(this,<%=rs("kcid")%>)">
......
谢谢了!!!