2008-03-18 JavaScript 取用 ASP.Net 2.0 的 RadioButtonList 與 CheckBoxList 58732 0 AJAX 2008-03-23 JavaScript 取用 ASP.Net 2.0 的 RadioButtonList 與 CheckBoxList <script type="text/javascript" > function getRadioButtonList( ) { var radioObj = document.getElementById ( "<%=RadioButtonList1.ClientID %>" ); var radioList = radioObj.getElementsByTagName ( 'input' ); for ( var i = 0; i < radioList.length; i++) { if (radioList[i].checked ) { alert (radioList[i].value ); } } } function getCheckBoxList( ) { var cboxObj = document.getElementById ( "<%=CheckBoxList1.ClientID %>" ); var cboxList = cboxObj.getElementsByTagName ( 'input' ); var lbList = cboxObj.getElementsByTagName ( 'label' ); for ( var i = 0; i < cboxList.length; i++) { if (cboxList[i].checked ) { alert (lbList[i].innerText ); } } } </script> ASP.NETchhuangAJAX 回首頁