<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该怎么写?

解决方案 »

  1.   

    <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>
      

  2.   

    放到函数里确实不错,正好我可以在浏览器做些验证。采用了,谢谢!
    另外,我记得可以直接写onclick里面的,只是格式稍微复杂,很久以前写过类似格式,现在忘了...
    望不吝赐教
      

  3.   

    改一下1楼的,注意是styleId不是id。。<html:select styleId="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=document.getElementById("jues").value;
     window.location='<%=request.getContextPath()%>/Login.do?step=step3&qxadd='+jues;
    }
    </script>
      

  4.   

    很简单 
    <html:select property="jues" value="11" id="selects">
    js中
    var selectValue = document.getElementById("selects").value;
    selectValue就是你想要的值