Connecting Tech Pros Worldwide Help | Site Map

can i use a table for disabling many checkboxes

Newbie
 
Join Date: May 2007
Posts: 22
#1: May 18 '07
hi
i have so many checkboxes inside a table can i disable all the checkboxes at once by disabling the table or is there any alternative (i have to use javascript becoz i need to do it in client side ).
pls suggest me in this regard
dmjpro's Avatar
Lives Here
 
Join Date: Jan 2007
Location: India (West-Bengal)
Posts: 2,451
#2: May 18 '07

re: can i use a table for disabling many checkboxes


plz try this code .......

assuming that all the checkboxes have the same name .... ........................ say test_checkbox.

so now write down .....

Quote:
var checkbox_ary = document.getElementsByName('test_checkbox');
for(var i=0;i<checkbox_ary.length;i++)
checkbox_ary[i].disabled = true.
now there is no need to disable the table.
best of luck.

kind regards.
dmjpro.
Reply


Similar JavaScript / Ajax / DHTML bytes