+ -
当前位置:首页 → 问答吧 → RS(int) 问题

RS(int) 问题

时间:2011-07-25

来源:互联网

<input type="checkbox" name="isNew" value="1" <%If CInt(Rs("isNew")) = 1 Then Response.Write " checked"%> />新品展示
  <input type="checkbox" name="isTop" value="1" <%If CInt(Rs("isTop")) = 1 Then Response.Write " checked"%>/>产品展示
  <input type="checkbox" name="isPro" value="1" <%If CInt(Rs("isPro")) = 1 Then Response.Write " checked"%>/>案例展示

数据库里面上面3个字段是 数字类型 都是0

为什么上面3语句都输出了checked

作者: cooc123   发布时间: 2011-07-25

确定?

作者: yaxiya   发布时间: 2011-07-25

引用 1 楼 yaxiya 的回复:
确定?


Rs 写错了。。。

作者: cooc123   发布时间: 2011-07-25

<%If CInt(Rs("isNew")) = 1 Then Response.Write " checked"%>
你这句判断就是这个意思。
表单Value="1" 你判断为1的时候,输出checked。

作者: loveinet_168   发布时间: 2011-07-25

<%If CInt(Rs("isNew")) = 1 Then Response.Write " checked"%>
改成这样
<%If Rs("isNew") = 1 Then Response.Write " checked"%>

作者: loveinet_168   发布时间: 2011-07-25