JS-asp:RadioButtonList
设置asp:RadioButtonList 属性 ;
RepeatDirection:默认纵排;Horizontal是指横排。
<div id="divDipart">
<asp:RadioButtonList ID="rblDipart" name="dipart" runat="server" RepeatDirection="Horizontal"
RepeatLayout="Table" Width="170px" TabIndex="4">
<asp:ListItem Selected="True" Value="0">IN</asp:ListItem>
<asp:ListItem Value="1">PC</asp:ListItem>
<asp:ListItem Value="2">OUT</asp:ListItem>
</asp:RadioButtonList>
</div>
获取asp:RadioButtonList的Item的值
var rblDipart=document.getElementById("rblDipart");//10072004 2014/09/16 追加
var radioArray=rblDipart.getElementsByTagName('input');
for(var i=0,len=radioArray.length;i<len;i++){
if(radioArray[i].type=='radio'&& radioArray[i].checked){
txtDipart=radioArray[i].value;
}
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.