关于asp instr函数问题。
本人菜鸟,刚接触Asp,现在做一个文章管理后台。为了实现一个复选框与下拉菜单动态关联的功能:
也就是勾选复选框的同时,显示下拉菜单。不选时,下拉菜单不显示。
问题如下:
//
错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: '[string: "2, 11, 18, 24, 32, 3"]'
//
以下是我代码:
<%
Dim SearchString, SearchChar, MyPos ,strtoSite
SearchString ="cautism,hnspe,cyyza,cxxkn,kdnlxl,guduzheng"
SearchChar = request("toSite")
MyPos = Instr(SearchString, SearchChar)
%>
<input name="toSite" type="checkbox" id="toSite" value="cautism"<% if Mypos >0 then Response.Write (" checked")%>>
cautism
<select name="toClassID" size="1" >
<%If isEdit Then%>
<option value="0"<%If Rs("toClassID") = 0 Then Response.Write (" selected")%>>请选择版块</option>
<option value="1"<%If Rs("toClassID") = 1 Then Response.Write (" selected")%>>新闻1</option>
<option value="2"<%If Rs("toClassID") = 2 Then Response.Write (" selected")%>>新闻2</option>
<option value="3"<%If Rs("toClassID") = 3 Then Response.Write (" selected")%>>新闻3</option>
<option value="4"<%If Rs("toClassID") = 4 Then Response.Write (" selected")%>>新闻4</option>
<option value="5"<%If Rs("toClassID") = 5 Then Response.Write (" selected")%>>新闻5</option>
<option value="6"<%If Rs("toClassID") = 6 Then Response.Write (" selected")%>>新闻6</option>
<option value="7"<%If Rs("toClassID") = 7 Then Response.Write (" selected")%>>新闻7</option>
<%Else%>
<option value="0"> </option>
<option value="1">新闻1</option>
<option value="2">新闻2</option>
<option value="3">新闻3</option>
<option value="4">新闻4</option>
<option value="5">新闻5</option>
<option value="6">新闻6</option>
<option value="7">新闻7</option>
<%End If%>
</select>