使用Javascript获取Treeview中Checked复选框的值 [英] Getting the value of checked checkbox in Treeview using Javascript

查看:100
本文介绍了使用Javascript获取Treeview中Checked复选框的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我们想使用Javascript在Treeview中获取选中复选框的值.我们无法在代码隐藏中做到这一点,因为treeview是动态的.我们可以使用javascript获取所选复选框的文本.如何获取使用JavaScript分配给表中文本的ID?

问候,
Prasad

Hello,

We want to get the value of checked checkbox in Treeview using Javascript. We cannot do it in codebehind as treeview is dynamic. We can get the text of the selected checkbox using javascript. How to get the ID, which is assigned to that text in table using JavaScript?

Regards,
Prasad

推荐答案

是否可以为复选框的onclick事件设置javascript方法?

如果是这样,请创建一个JavaScript方法ex
Is it possible for you to set a javascript method to the checkbox''s onclick event?

if so , create a javascript method ex
function CheckBoxOnClick(obj){
alert(obj.id);
}



然后将其设置为复选框onclick ="CheckBoxOnClick(this);"



and then to the checkbox you set it as onclick = "CheckBoxOnClick(this);"


这篇关于使用Javascript获取Treeview中Checked复选框的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆