标题:关于asp instr函数问题。
只看楼主
xinghg88
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-11-10
 问题点数:0 回复次数:0 
关于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>           
搜索更多相关主题的帖子: instr 函数 asp 
2010-11-10 16:13



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-325485-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024197 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved