<body>
表单选项:<label>
<select name="select">
<s:iterator id="li" value="proList">
   <option>${li.projectname}</option>
</s:iterator>
<input type="button" onclick="javascript:locaion.href='add?id=';" value="确定"/>
</select>
</label>
  </body>---------------------------------------------------------------------------------
我想点击确定按钮能得到选定下拉框值得ID  或者值 ,  如何活的,并且我要将得到的值传给action

解决方案 »

  1.   

    给select这个控件设置一个ID,每个Option配置Value。
    通过获取Value, document.getElementById("id").value就可以获取指定的选择了。<select id='main'>
     <option value='www.163.com'>网易</option>
    </select>
      

  2.   

    var ddl = document.getElementById("selectId"); 
    //id
    var index = ddl.selectedIndex; 
    //value
    var value = ddl.options[index].value; 
    text
    var text = ddl.options[index].text;
     
     
      

  3.   


    给下拉框设置一个id , 每个option 都有 value 属性然后用jquery, var val = $("#id").val();这个 val 就是当前选中项的值