读取二级下拉框

kingsjava 2007-04-10 02:16:40
<script language="JavaScript">
var onecount; //定义onecount对像
onecount=0; //初始值为0
subcat=new Array(); //SUBCAT对像是一个新的数组
<%
int count=0;
ArrayList pro_lifts=main_Produmain.getSproduList();
int my_pro_lift_a=pro_lifts.size();
for(int i=0;i<my_pro_lift_a;i++)
{
Map my_rs2=(Map)pro_lifts.get(i);
%>
subcat[<%out.print(count);%>]=new Array('<%out.print(my_rs2.get("s_c_name"));%>','<%out.print(my_rs2.get("b_c_id"));%>','<%out.print(my_rs2.get("s_c_id"));%>');

<%
count=count+1;
}
%>
onecount=<%out.print(count);%>;

function changelocation(S_ID)
{
document.form1.smalllocation.length=0;
var S_ID=S_ID;
var i;
document.form1.smalllocation.options[0]=new Option('二类型','');
for (i=0;i<onecount;i++)
{
if (subcat[i][1]==S_ID)
{
document.form1.smalllocation.options[document.form1.smalllocation.length]=new Option(subcat[i][0],subcat[i][2]);
}
}
}

</script>

<select name="smalllocation" class="kk" onChange="changelocation2(document.form1.smalllocation.options[document.form1.smalllocation.selectedIndex].value)">


<option selected value="">二类型</option>



</select>
...全文
157 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
adverse 2007-04-10
  • 打赏
  • 举报
回复
<%out.print(count);%>把这样的都换成<%=count%>
另外你这个是报什么错误了?
kingsjava 2007-04-10
  • 打赏
  • 举报
回复
兄弟们,,出错了,看不出是那错了

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧