为什么得不到RadioButtonList1的值?
<form name="Form1" method="post" action="GetPropertyNo.aspx" id="Form1">
<table ><tr><td><table id="RadioButtonList1" border="0">
<tr>
<td><input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="001" /><label for="RadioButtonList1_0">集体</label></td>
</tr><tr>
<td><input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="002" /><label for="RadioButtonList1_1">股份制</label></td>
</tr>
</table></td></tr></table>
<INPUT TYPE="button" class="MyButton" value="确定" onclick="fnGetInfo();" <INPUT TYPE="button" value="取消" onclick="fnCancel();">
</form>
<SCRIPT>
function CheckBox(CheckBoxSet)
{
var str;
str='';
for(i=0;CheckBoxSet.length-1;i++)
{
if(CheckBoxSet(i).checked)
{
str=CheckBoxSet(i).value
}
//str=CheckBoxSet.value;
}
return str;
}
</SCRIPT>
上述调用 CheckBox(document.Form1.RadioButtonList1) 为何得不到 所选的值?
问题点数:0、回复次数:2Top
1 楼clkun(我来是学习)回复于 2005-06-02 01:38:28 得分 0
用这个方法得到了
function CheckBox()
{
var str;
str='';
var obj=document.getElementsByName("RadioButtonList1");
for(i=0;i<obj.length;i++)
{
if(obj[i].checked)
{
str=obj[i].value;
}
//str=CheckBoxSet.value;
}
return str;
}Top
2 楼czhenq(...... fucking life. I want to change.)回复于 2005-06-02 01:38:52 得分 0
需使用name的值,不能使用id的值Top




