troubleshooting Question

iterating through GridView and trying to figure out how to check if the check box controlled is enabled or not ??

Avatar of brgdotnet
brgdotnetFlag for United States of America asked on
JavaScript
4 Comments1 Solution109 ViewsLast Modified:
How can I check if my check box control is enabled or not? I have tried the following code check :
if(inputList[i].disabled) {  }

But it does not work, because there is not a "disabled" property for my check box control.

The GridView was created dynamically in asp.net but ultimately I need to be able to set the values using Java script. All the code below works great except I don't know how to check if the checkbox is enabled or not? My goal is to check the checkbox if it is indeed disabled.

function UncheckAll(objectRef)
{

  var row = objectRef.parentNode.parentNode;
  var GridView = row.parentNode;
  var inputList = GridView.getElementByTagName("input");
  

 for(var i = 0; i < inputList.length; i++)
  {
     if(inputList[i].type == "checkbox")
	{
          if(inputList[i].disabled) // .disabled is not a property, so how can I check if it is enabled or not?
          {

          }
	  
	}


  }


}
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros