<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: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>
另外,我记得可以直接写onclick里面的,只是格式稍微复杂,很久以前写过类似格式,现在忘了...
望不吝赐教
<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>
<html:select property="jues" value="11" id="selects">
js中
var selectValue = document.getElementById("selects").value;
selectValue就是你想要的值