1

我的 JSP 中有一个下拉菜单。如何从<html:options>JSP 中的标签中获取选定的值。

<html:select property="temp_Id"  >  
<html:options collection="listmap" property="key"/>  
</html:select>  
4

1 回答 1

0

将您的标签更改为

<html:select property="temp_Id" styleId = "tempId" >
html:options collection="listmap" property="key"/>  
</html:select>

在您的 java 脚本中添加以下内容

var e = document.getElementById("tempId");
var strUser = e.options[e.selectedIndex].value;  

这应该可以。谢谢。

于 2013-07-17T11:01:07.107 回答