js如何获得循环内下拉列表中的值

Tmac柴 2013-05-26 08:55:21
<% Object Shopping = session.getAttribute("ShoppingCar");
if(Shopping != null)
{
Set<Goods> ShoppingCar = (Set<Goods>)Shopping;
Iterator<Goods> it = ShoppingCar.iterator();
while(it.hasNext())
{
Goods itnext = it.next();

%>
<tr>
<td><%=itnext.getName() %></td>
<td><%=itnext.getInstruction() %></td>
<td><%=itnext.getPrice() %></td>
<td>
<select name="<%=itnext.getId() %>" id="<%=itnext.getId()%>" size="1" onchange="return updatenumber('<%=itnext.getId()%>')">
<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>
</select>
</td>
<td><a href="javascript:void(0)" onclick="return deleteById('<%=itnext.getId()%>');">删除</a></td>
</tr>
<%
}
}

%>
...全文
211 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
NANU-NANA 2013-05-27
  • 打赏
  • 举报
回复
直接用js里的menu多好
似梦飞花 2013-05-27
  • 打赏
  • 举报
回复
var sel=document.getElementById("sel"); alert(sel[sel.selectedIndex].value); ??不明白你的意思
Andy猪猪侠 2013-05-27
  • 打赏
  • 举报
回复
lz,你是要获取循环后的所有下拉框选中的值吗?

87,992

社区成员

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

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