Js中得到radiobuttonlist 和CheckBoxList 的值
时间:2011-05-05 来源:笨笨的菜鸟
得到radiobuttonlist 选中值:
var CheckBoxList=document.all.optButtonList;
var objCheckBox,CheckValue="";
for(i=0;i<CheckBoxList.rows.length;i++)
{
objCheckBox = document.getElementById('optButtonList'+ "_" + i);
if(objCheckBox.checked == true)
{
CheckValue = objCheckBox.value;
}
}
if(CheckValue!="")
{
alert(CheckValue) ; }
得到 CheckBoxList 选中值
var CheckBoxList=document.all.checkList;
var objCheckBox,CheckValue="";
for(i=0;i<CheckBoxList.rows.length;i++)
{
objCheckBox = document.getElementById("checkList_" + i);
if(objCheckBox.checked == true)
{
CheckValue += CheckBoxList.rows[i].cells[0].childNodes(1).innerText + ",";
}
}
if(CheckValue!="")
{
alert(CheckValue);
}
var CheckBoxList=document.all.optButtonList;
var objCheckBox,CheckValue="";
for(i=0;i<CheckBoxList.rows.length;i++)
{
objCheckBox = document.getElementById('optButtonList'+ "_" + i);
if(objCheckBox.checked == true)
{
CheckValue = objCheckBox.value;
}
}
if(CheckValue!="")
{
alert(CheckValue) ; }
得到 CheckBoxList 选中值
var CheckBoxList=document.all.checkList;
var objCheckBox,CheckValue="";
for(i=0;i<CheckBoxList.rows.length;i++)
{
objCheckBox = document.getElementById("checkList_" + i);
if(objCheckBox.checked == true)
{
CheckValue += CheckBoxList.rows[i].cells[0].childNodes(1).innerText + ",";
}
}
if(CheckValue!="")
{
alert(CheckValue);
}
相关阅读 更多 +