try
var index=document.form1.rblTime.slectedindex;
alert(index);
var index=document.form1.rblTime.slectedindex;
alert(index);
解决方案 »
- Fill: SelectCommand.Connection 属性尚未初始化。 找不到web.config配置文件
- 级联式下拉列表
- ASP.NET如何创建动态控件被能被其他的按钮调用
- 我的页面引用了母版页,那我的本页的css样式怎么样引用?
- js遍历TreeView选中节点
- 请教一个在asp.net页面中显示图片的问题
- html布好的局.在.NET2005就不行..不是html的布局
- 关于DataSet 写入数据库的问题
- 今天写了个将DataSet数据层中的值映射为表示层中需要的值的方法,发放~~
- 关于ASP.NET的DataColumn对象的问题
- 菜鸟问题:怎样在编写自定义控件输出javascript代码?
- datagrid消失了!
我在html的function中写了这两句
var rblTime=document.getElementById("rblTime");
alert(rblTime);
但显示null.奇怪。
document.all("rblTime").selectedIndex
<asp:radiobuttonlist id="RadioButtonList1" runat="server">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
</asp:radiobuttonlist>
发送到客户端后是
<table id="RadioButtonList1" border="0">
<tr>
<td><input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="1" /><label for="RadioButtonList1_0">1</label></td>
</tr><tr>
<td><input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="2" /><label for="RadioButtonList1_1">2</label></td>
</tr>
</table>
function GetSelectedRadio()
for each ob in document.all.tags("input")
if ob.type="radio" then
if ob.checked then
alert(ob.nextSibling.innerText)
end if
end if
next
end function
</script>
WebForm1.TextBox1.style.display="none"
for (i=0;i<radioSelectNum;i++)
{
if (document.all.tags("input").item(i).checked="checked")
{
alert('ok '+ i);
}
}
if (document.all.Radioname[i].checked)
alert(i)
}
现在我想从tags标号中得到该控件的ID,如何能做到呢?
我用了(document.all.tags("input").item(i).type="radio") ,但去提示没有type属性。