function ChkRadio(){
var strRadio = document.getElementById('<%= RadioButtonList1.ClientID %>'); ←改成自己的名字
var i ;
var selValue = 0 ; 
for(i=0; i<strRadio.rows[0].cells.length; i++){
if(strRadio.rows[0].cells[i].childNodes[0].checked == true){
selValue += 1; 
}
}
if(selValue == 0){
alert("錯誤!!")
return false; 
}   
}

PS. 要注意的是,這裡的RadioButtionList是用水平橫式的(Horizontal),如果用直式的(Vertical),table.rows[0].cells[i]要改為table.rows[i].cells[0]。

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 雪貓寶寶 的頭像
    雪貓寶寶

    單純、幸福

    雪貓寶寶 發表在 痞客邦 留言(0) 人氣()