I want to disable a table with javascript

P

prado

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
 
L

Laurent Bugnion

Hi,
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
 
I

Ivo

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/
 
L

Laurent Bugnion

I

Ivo

<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
 
L

Laurent Bugnion

Hi,
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top