Wednesday, 4 September 2013

Enable Disable all control inside div or panel using javascript

function chek() {

          var chk2 = document.getElementById("<%=checkbox1v.ClientID%>");

          if (chk2.checked == true) {
              var nodes = document.getElementById("<%=Panel1.ClientID%>").getElementsByTagName('*');
              for (var i = 0; i < nodes.length; i++) {
                  nodes[i].disabled = true;
              }
          }
          else {
              var nodes = document.getElementById("<%=Panel1.ClientID%>").getElementsByTagName('*');
              for (var i = 0; i < nodes.length; i++) {
                  nodes[i].disabled = false;

              }
          }
      }

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...