世界有名的锅具品牌:asp中,如何使用复选框

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 03:54:27
如何实现复选框判断功能 请看show.asp内容
add.asp页面 代码
<input type="checkbox" name="chengjiaocount" value="1">白
<input type="checkbox" name="chengjiaocount" value="2">黑
<input type="checkbox" name="chengjiaocount" value="3">蓝
<input type="checkbox" name="chengjiaocount" value="4">白
<input type="checkbox" name="chengjiaocount" value="5">绿
rs1("chengjiaocount")=Replace(request("chengjiaocount")," ","")
//添加选中的复选框的值到数据库中,这里我选择1和3 存放在数据库中的值为13

show.asp 页面代码
<input type="checkbox" name="chengjiaocount" value="1">白
<input type="checkbox" name="chengjiaocount" value="2">黑
<input type="checkbox" name="chengjiaocount" value="3">蓝
<input type="checkbox" name="chengjiaocount" value="4">白
<input type="checkbox" name="chengjiaocount" value="5">绿
读取数据库中的13 并且把13设置成已经选择

<input type="checkbox" name="chengjiaocount" value="1" <%if instr(rs1("chengjiaocount"),1)>0 then
response.write "checked"
end if%>>白
下面的依次类推:if instr(rs1("chengjiaocount"),2)>0 then
if instr(rs1("chengjiaocount"),3)>0 then
if instr(rs1("chengjiaocount"),4)>0 then