本文介绍了禁用时出现问题并使用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.

推荐答案

chkCourses.disable = false; chkCourses.disable = true;



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



-SA


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

09-03 12:02