asp split()中,引起的错误

来源:百度知道 编辑:UC知道 时间:2024/05/21 13:01:46
dim showtype
showtype=split(trim(request("showtype")),",")
rs2("shop_gridename")=trim(showtype(0))
rs2("shop_gride")=trim(showtype(1))

******************************
<select name="showtype">
<%do while not rs1.eof
tn = trim(rs1("name"))
tn8 =trim(rs("shop_gridename"))
st=""
if tn = tn8 then st=" selected "
if tn <>"" then tn=replace(tn,",","")
%>
<option <%=st%> value='<%=tn%>,<%=rs1("id")%>' ><%=rs1("name")%></option>
<%rs1.movenext
loop
rs1.close
set rs1=nothing
%>
</select>

************************
<input type="text" name="name" size="30" value=&quo

request("showtype")
showtype(0)
showtype(1)

都打印出来看看,可以hi我

request("showtype") 获得的值至少应该是这样的 abc,def
也就是说至少有一个,号否则根据你的程序肯定出错的.

showtype=split(trim(request("showtype")),",")

这里应该判断showtype的数组里面是否至少包含两个数据
if ubound(showtype)>=1 then
rs2("shop_gridename")=trim(showtype(0))
rs2("shop_gride")=trim(showtype(1))
else
....
end if

我同意2楼的意见

,和 ,

注意比较下,中英文模式下的的区别