function selHotel()
{
var HotelCode ="";
var intValid = document.frm.selHotel.length;
if(document.frm.selHotel.checked == true )
{
HotelCode = document.frm.selHotel.value;
}
if(intValid >1)
{
for(var i =0;i
{
//alert(document.frm.selHotel[i].checked);
if (document.frm.selHotel[i].checked== true )
{
HotelCode = document.frm.selHotel[i].value;
//alert(HotelCode);
}
}
}
}
当然还可以用DWRUtil.getValue("selHotel");取值。
在只有一个radio时,那么document.frm.selHotel.checked 值为true或flase,DWRUtil.getValue("selHotel")的值为true或flase,radio的值为document.frm.selHotel.value即true或flase。
如果有多个radio时,那么document.frm.selHotel[i].checked 值为true或flase,DWRUtil.getValue("selHotel")的值为document.frm.selHotel[i].value,radio的值为document.frm.selHotel[i].value。