Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. disable controls

disable controls

Scheduled Pinned Locked Moved ASP.NET
javascriptsysadmin
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PrakashACCS
    wrote on last edited by
    #1

    Hi guys good morning!! I want javascript code to disable the server controls inside a table or a div tag. In detail... when i check a particular checkbox all the controls in a table should get enabled... and if a I uncheke the checkbox all the controls in the table should get disabled. I have used the following code if(checkbox1.checked==true) { for(var i = 0; i< table1.length; i++) { if(table1[i].type == 'checkbox') { table1[i].disabled =true; } } } but it could not work. I can use div tags insted of tables.. please suggest in this regards. Thanks in advance... regards Prakash

    PraCash

    S S 2 Replies Last reply
    0
    • P PrakashACCS

      Hi guys good morning!! I want javascript code to disable the server controls inside a table or a div tag. In detail... when i check a particular checkbox all the controls in a table should get enabled... and if a I uncheke the checkbox all the controls in the table should get disabled. I have used the following code if(checkbox1.checked==true) { for(var i = 0; i< table1.length; i++) { if(table1[i].type == 'checkbox') { table1[i].disabled =true; } } } but it could not work. I can use div tags insted of tables.. please suggest in this regards. Thanks in advance... regards Prakash

      PraCash

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      You can't do that by using table one way is place all the controls in the Placeholder and disable the placehoder in the javascript .....

      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      1 Reply Last reply
      0
      • P PrakashACCS

        Hi guys good morning!! I want javascript code to disable the server controls inside a table or a div tag. In detail... when i check a particular checkbox all the controls in a table should get enabled... and if a I uncheke the checkbox all the controls in the table should get disabled. I have used the following code if(checkbox1.checked==true) { for(var i = 0; i< table1.length; i++) { if(table1[i].type == 'checkbox') { table1[i].disabled =true; } } } but it could not work. I can use div tags insted of tables.. please suggest in this regards. Thanks in advance... regards Prakash

        PraCash

        S Offline
        S Offline
        Sherin Iranimose
        wrote on last edited by
        #3

        Hi, In page load mainchecbox.Attributes.Add("OnClick", "JavaScript:YourJSFun('" & table1.ClientID & "'," & mainchecbox.ClientID & ");") and your java script function YourJSFun(table,value) { document.getElementById(table).setAttribute("disabled",val.checked); } try this.


        If U Have Interest, U Can... Sherin Iranimose


        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups