disable controls
-
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
-
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
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... "
-
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
Hi, In page load
mainchecbox.Attributes.Add("OnClick", "JavaScript:YourJSFun('" & table1.ClientID & "'," & mainchecbox.ClientID & ");")
and your java script functionYourJSFun(table,value) { document.getElementById(table).setAttribute("disabled",val.checked); }
try this.
If U Have Interest, U Can... Sherin Iranimose