By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,369 Members | 1,138 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,369 IT Pros & Developers. It's quick & easy.

I want to disable a table with javascript

P: n/a
I want to disable a table with javascript. In this table i have 'n'
record and each record has 3 buttons. If you click a button does an
action. I want to disable the all table.

is there any way to disable all this table without have to disable each
button of each record?

Thanks

Jun 13 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Hi,

prado wrote:
I want to disable a table with javascript. In this table i have 'n'
record and each record has 3 buttons. If you click a button does an
action. I want to disable the all table.

is there any way to disable all this table without have to disable each
button of each record?

Thanks


No, you cannot disable all of them in one operation. However, you can
get an array of elements using document.getElementsByTagName. Or, you
can give your buttons a clever ID and use many document.getElementById
calls. But at one point or the other, you'll have to loop through the
elements to identify them and disable them.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Jun 13 '06 #2

P: n/a
Ivo
"Laurent Bugnion" wrote

prado wrote:
is there any way to disable all this table without have to disable each
button of each record?


No, you cannot disable all of them in one operation. However, you can get
an array of elements using document.getElementsByTagName. Or, you can give
your buttons a clever ID and use many document.getElementById calls. But
at one point or the other, you'll have to loop through the elements to
identify them and disable them.


Are you sure? Wouldn't the same effect be had if the whole table is wrapped
in <form></form> tags and the form is disabled as one?

hth
ivo
http://4umi.com/web/javascript/
Jun 13 '06 #3

P: n/a
Can you put an example if this, please.

Jun 13 '06 #4

P: n/a
Ivo
"prado" wrote
is there any way to disable all this table without have to disable
each button of each record?
Can you put an example if this, please.


Sure, see here: http://4umi.com/web/javascript/tableable.htm

btw, please quote some of what you're replying to, that makes it easier for
the newsgroup to follow the discussion.
hth
ivo
Jun 13 '06 #5

P: n/a
Hi,

Ivo wrote:
"Laurent Bugnion" wrote
prado wrote:
is there any way to disable all this table without have to disable each
button of each record?


No, you cannot disable all of them in one operation. However, you can get
an array of elements using document.getElementsByTagName. Or, you can give
your buttons a clever ID and use many document.getElementById calls. But
at one point or the other, you'll have to loop through the elements to
identify them and disable them.

Are you sure? Wouldn't the same effect be had if the whole table is wrapped
in <form></form> tags and the form is disabled as one?


<form> doesn't have a "disabled" attribute. The code at
http://4umi.com/web/javascript/tableable.htm
is not standard, and thus doesn't work in Firefox.

http://www.w3.org/TR/1999/REC-html40...html#edef-FORM
and
http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-40002357

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Jun 13 '06 #6

P: n/a
Ivo

"Laurent Bugnion" wrote
Ivo wrote:
"Laurent Bugnion" wrote
prado wrote:
is there any way to disable all this table without have to disable each
button of each record?

No, you cannot disable all of them in one operation. However, you can get
an array of elements using document.getElementsByTagName. Or, you can
give your buttons a clever ID and use many document.getElementById calls.
But at one point or the other, you'll have to loop through the elements
to identify them and disable them.


Are you sure? Wouldn't the same effect be had if the whole table is
wrapped in <form></form> tags and the form is disabled as one?


<form> doesn't have a "disabled" attribute. The code at
http://4umi.com/web/javascript/tableable.htm
is not standard, and thus doesn't work in Firefox.


Darn, you 're right. I just noticed in IE even when a button looks disabled
and is grayed out in a "disabled" form, a click still fires its onclick
event handler function... This really shouldn't be happening! Yet another
dream shattered.
ivo
Jun 13 '06 #7

P: n/a
Hi,

Ivo wrote:
Are you sure? Wouldn't the same effect be had if the whole table is
wrapped in <form></form> tags and the form is disabled as one?


<form> doesn't have a "disabled" attribute. The code at
http://4umi.com/web/javascript/tableable.htm
is not standard, and thus doesn't work in Firefox.

Darn, you 're right. I just noticed in IE even when a button looks disabled
and is grayed out in a "disabled" form, a click still fires its onclick
event handler function... This really shouldn't be happening! Yet another
dream shattered.
ivo


The fact that IE supports so many incompatible, non-standard "features"
is the biggest plague in the world of web software engineering.

IE7 will be much better from what I heard and saw at MIX06, but
unfortunately they have to support the old stuff or else the web will
stop working...

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Jun 13 '06 #8

P: n/a
Thanks a lot.

Jun 14 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.