- HTML code
<html:select property="jues" value="11"> <html:option value="11">基本查询</html:option> <html:option value="12">综合查询</html:option> <html:option value="13">权限管理</html:option> </html:select> <a style="cursor: pointer;color:blue" onclick="window.location='<%=request.getContextPath()%>/Login.do?step=step3&qxadd=?'">授予该权限</a>
请教下"?"处如何利用js获得select的value值,完整的url该怎么写?
------解决方案--------------------
<html:select id="jues" property="jues" value="11">
<html:option value="11">基本查询</html:option>
<html:option value="12">综合查询</html:option>
<html:option value="13">权限管理</html:option>
</html:select>
<a style="cursor: pointer;color:blue" onclick="test();">授予该权限</a>
<script>
function test(){
var jues=$("#jues").val();
window.location='<%=request.getContextPath()%>/Login.do?step=step3&qxadd='+jues;
}
</script>
------解决方案--------------------
改一下1楼的,注意是styleId不是id。。
- JScript code
<html:select [color=#FF0000]styleId="jues"[/color] property="jues" value="11"> <html:option value="11">基本查询</html:option> <html:option value="12">综合查询</html:option> <html:option value="13">权限管理</html:option> </html:select> <a style="cursor: pointer;color:blue" onclick="test();">授予该权限</a><script>function test(){ var jues=document.getElementById("jues").value; window.location='<%=request.getContextPath()%>/Login.do?step=step3&qxadd='+jues;}</script>