二级联动菜单返回值问题
我要取到tpid的值,用request.form(tpid)取不到,是什么问题啊?<select name="prid" onChange="javascript:changeclass2();">
<option value="" selected>选择大类</option>
<%
Sql="Select * From dig"
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open Sql,dbConn,1,1
do while not rs.eof
Response.write "<option value='"&rs("prid")&"'>"&rs("pname")&"</option>"
rs.movenext
loop
Response.write "</select>"
Rs.Close
Set Rs = Nothing
%>
<select name="tpid" >
<option value="" selected>选择小类</option>
</select>
<input name="price" type="hidden" id="price" value="" />
<%
Sql="Select * From dig1"
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open Sql,dbConn,1,1
do while not rs.eof
str=str&rs("prid")&"-"&rs("tpid")&"-"&rs("ptypename")&","
rs.movenext
loop
Rs.Close
Set Rs = Nothing
%>
<!--下面是实现动态改变下一级菜单的脚本代码-->
<script LANGUAGE="javascript">
arr="<%=str%>".split(",");
a=arr.length
ar=new Array()
for (i=0;i<a;i++){
ar[i]=arr[i].split("-");
}
function changeclass2() {
document.FrmAddLink.tpid.length=1
lid=FrmAddLink.prid.value;
document.FrmAddLink.price.value=lid
for (i=0;i<a;i++) {
if (ar[i][0] == lid) {
document.FrmAddLink.tpid.options.add(new Option(ar[i][2],ar[i][1]));
}
}
}
</script>