473,387 Members | 1,650 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,387 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 25162
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.