473,426 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,426 software developers and data experts.

I want to disable a table with javascript

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
8 25167
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
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
Can you put an example if this, please.

Jun 13 '06 #4
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
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
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
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
Thanks a lot.

Jun 14 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: nntp | last post by:
I have a set of links which I want search engines to crawl them, but I want to disable them from my visitors, so I will ask the link owners to pay me to let me enable them. <a disabled...
12
by: Forti2ude | last post by:
Hello, I have a simple form... <form> <select name="foo" multiple> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select>
0
by: talal | last post by:
How to check whether javascript is enable or disable in client browser. Remeber i can check wheter browser client support javascript with BrowserCapability class. But what if the client has disable...
1
by: Bob | last post by:
Does anyone know how to disable javascript in the new Netscape 8 -- for off line testing (like can be done readily with the current MSIE, Firefox or Opera browsers) ? When I try tools -> options...
6
by: Mike | last post by:
I have a form that contains 240 "products". Each Product has a TR. Each TR contains a Yes and No radio button and a Product-Qty text input. A situation exists where I have to go through all the...
4
by: SteveKlett | last post by:
I have a subset of form items that I need to perform different operations on (enable/disable, clear values, change style, etc) rather than hard code the IDs or names I would like to recursively...
3
by: bhanubalaji | last post by:
hi, I am unable to disable the text(label) in javascript..it's working fine with IE,but i am using MOZILLA.. can any one help regarding this.. What's the wrong with my code? I am...
8
by: alamodgal | last post by:
hiiiiiiiiiii everybody, pls solve my problem if u can? Actualy what happens in my site when i press enter key it will show some secured...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.