禁用时出现问题并使用JavaScript启用CheckboxList [英] Problem while disable and enable CheckboxList using JavaScript

查看:71
本文介绍了禁用时出现问题并使用JavaScript启用CheckboxList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个网格,在网格中我有每个行的CheckboxList和一些listitems。在网格之外我有另一个复选框,基于外部复选框选择我正在使用Javascript启用和禁用gridview中的行。 gridview中的所有控件(如文本框,下拉列表)都正常工作,但CheckboxList除外。



我调试并看到了gridview的innerHTML CheckboxList我观察到每个Listitem(span标签)都已正确禁用。我如何才能解决这个问题。



我的javascript代码就像单击外部复选框一样我在网格元素中做启用和禁用



ex。 txtName.disable = false; txtName.disable = true;

chkCourses.disable = false; chkCourses.disable = true; //这不起作用

ddlCollege.disable = false; ddlCollege.disable = true;



请帮帮我。

Hi All,
I have a grid, inside grid i have CheckboxList for each row with some listitems. Outside of grid i have another checkbox, basing on outside checkbox selection i am enabling and disabling rows in gridview using Javascript. All controls inside gridview (like textbox, dropdownlist) are working properly except CheckboxList.

I debugged and saw innerHTML for gridview CheckboxList i observed for each Listitem(span tag) having disabled properly. How i can resolve this issue.

My javascript code as on clicking of outside checkboxlist i am doing inside grid elements as "enable" and "disable"

ex. txtName.disable = false; txtName.disable = true;
chkCourses.disable = false; chkCourses.disable = true;// this is not working
ddlCollege.disable = false; ddlCollege.disable = true;

Please help me.

推荐答案

请看我对这个问题的评论。没有人能看到你真正想做的事情。它似乎没有任何意义。



但我们假设你真的有一个 chkCources 正确定义和初始化,属性 disable 确实存在,并做它应该做的事情。我对此表示怀疑,但让我们假设它。即便如此,请查看您的行
Please see my comment to the question. Nobody can see what you are really trying to do. It does not seem to make any sense.

But let's assume for a minute that you really have chkCources properly defined and initialized, and the property disable really exists and does what it should do. I doubt it, but let's assume it. Even then, look at your line
chkCourses.disable = false; chkCourses.disable = true;



怎么可能有效呢?如果已启用,则将启用状态;如果是禁用,则第一个语句不执行任何操作。



-SA


这篇关于禁用时出现问题并使用JavaScript启用CheckboxList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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