用javascript如何取到<html:optionsCollection>的选中的值啊

解决方案 »

  1.   

    <html:optionsCollection> 这是什么?LZ 的意思是 Select 的 options 集合吧?var oSelect = document.getElementById("mySelectId");
    alert(oSelect.options.length); // oSelect.options 也许是 LZ 要找的
      

  2.   

    <html:select property="select1">
    <html:optionsCollection  property="beanCollection1" label="label" value="value"/>
    </html:select>
    <html:select property="select2" onchange="add_person()">
    <html:optionsCollection  property="beanCollection2" label="label" value="value"/>
    </html:select>
    <html:select property="select5" style="display:none">
    <html:option value="人事部">张三</html:option>
    <html:option value="人事部">李四</html:option>
    <html:option value="人事部">王强</html:option>
    <html:option value="财务部">毛建</html:option>
    <html:option value="财务部">王梨</html:option>
    <html:option value="财务部">赵华</html:option>
    <html:option value="技术部">陈强</html:option>
    <html:option value="技术部">张飞</html:option>
    <html:option value="技术部">关羽</html:option>
    </html:select><br>
    <html:select property="select3" multiple="true">
    </html:select>
    我的意思是想通过一个JS 把对应的参数传到 select3里面
      

  3.   

    晕,原来是 xml 文件的读取问题!