首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

checkbox 值得编辑 多值就选中不了,该如何解决

2013-01-25 
checkbox 值得编辑 多值就选中不了td%for i1 to rs4.recordcount%inputtypecheckboxnamerole

checkbox 值得编辑 多值就选中不了
<td><%for i=1 to rs4.recordcount%>
      <input  type="checkbox"   name="role" value="<%=rs4("RoleID")%>" <%if(instr(cstr(rs4("RoleID")),rs("Roles"))>0)then Response.Write("checked") end if%>><%=rs4("RoleName")%></option>
 <% rs4.movenext
next
%></td>
以上代码错在哪里 ,为什么checkbox 当rs("Roles") 由多个值组成的一个串(比如:"3, 2, 1") 一直处在未选中状态? ,一个值的就可以选中(比如:"3")
[解决办法]
http://www.w3school.com.cn/vbscript/func_instr.asp

instr(a, b)

搞清楚,是a中找b,还是b中找a

热点排行