当前位置: 代码迷 >> Web前端 >> 页面中上拉列表和多选框
  详细解决方案

页面中上拉列表和多选框

热度:14   发布时间:2012-10-28 09:54:44.0
页面中下拉列表和多选框

下拉列表选择值的获取

html页面:

<select id="appType2"
   onchange="searchTypeSelect(this.options[selectedIndex].value,this.options[selectedIndex].text);">
   <option value="-1">--请选择--</option>
   <option value="个人">个人</option>
   <option value="公司">公司</option>

  </select><input type="hidden" name="appTypeHidden" id="appTypeHidden"
   value="-1" class="inputText" />

?

JS方法获得下拉列表的值

???????

 function searchTypySelect(selectValue,selectText){
          // selectValue即下拉列表选择的value值
       // selectText即下拉列表选择的 text值  

          }

多选框值的获取

html页面:

<tr>
        <th>应用所需资源:</th>
        <td><input type="checkbox" value="calute" name="appDepentRes"/> 计算 &nbsp;
		&nbsp;&nbsp;&nbsp;<input type="checkbox" value="store" name="appDepentRes"/>存储</td>

</tr>

?

Jquery获得多选按钮的值

var appName="";
$("input[name='appDepentRes']:checked").each(function(){
        appName+=this.value+";";
})

?

  相关解决方案