为RadioButtonList添加页面的onclick事件
来源:互联网 发布:搜狗关键词优化软件 编辑:程序博客网 时间:2024/05/07 22:43
在head 中写脚本如下:
<script language="javascript" type="text/javascript">
function drpchange(rad)
{
var drp = document.getElementById("dv1");
var text = document.getElementById('txtquery');
if(rad.value=="5")
{
text.onclick = function()
{
parent.open('selectdate.aspx','','height=250,width=250');
text.ReadOnly = true;
};
}
else
{
text.ReadOnly = false;
text.onclick = function(){};
text.value = '';
}
if(rad.value=="1")
{
drp.style.display="block";
text.style.display="none";
}
else
{
drp.style.display="none";
text.style.display="";
}
}
</script>
此脚本为下面要为RadioButtonList添加的onclick事件.
在Page_Load()里里面写入如下代码:
for (int i = 0; i < RadioButtonList1.Items.Count; i++)
{
RadioButtonList1.Items[i].Attributes.Add("onclick", "drpchange(this)");
}
一定要注意不要将上面的写在if(!Page.IsPostBack)里面!
- 为RadioButtonList添加页面的onclick事件
- 用Tag区分Click事件(为动态生成的页面添加onClick事件)
- 为.net里面的RadioButtonList添加选择事件
- 为TextBox添加onclick事件
- 为iframe添加onclick事件
- 为iframe添加onclick事件
- jsp页面的onclick事件
- jquery给net里面的RadioButtonList添加选项改变事件
- 添加java脚本的onclick事件
- 添加java脚本的onclick事件
- jsp页面onclick事件
- 新增button控件为其添加onClick事件及Text
- jquery为a标签添加和移除onclick事件
- 2,JQuery学习-为页面的元素添加点击事件
- 给 iframe 添加 onclick 事件
- jquery 动态添加onclick事件
- 给按钮添加onClick事件
- 给超链接添加onclick事件
- A simple Example of using Video Textures in Managed DirectX (C#)
- IT打工
- 暴汗,关于javascript的parseInt()的一个问题
- 最经典的解释---中国足球怎么老输
- 利用vc 6.0目录下的cl.exe直接编译程序的方法
- 为RadioButtonList添加页面的onclick事件
- 会员等级图标js脚本
- 都被吓了一跳
- Linux Grep命令使用的详细介绍
- gzip压缩算法
- “笑着进来,哭着出去”
- 昨晚看了一通宵JAVA
- Eclipse快捷键汇总
- IIS 配置web service