webspeeder — 2008-04-29T16:00:05-04:00 — #1
I'm looking to disable/enable table rows on events but what I'm using is not working.
The table row ID is "row1", so I use document.getElementById("row1").disabled = true;
That doesn't work. I'm using FF, tested it in IE and the fields are "grayed" out but you can still enter text inside them.
jimbo_dk — 2008-04-29T21:07:22-04:00 — #2
You can't really disable a table row, since it's not an input element. (not sure why IE chooses to do it for some reason). What you need to do is to make the row grey by using a css class, or alternatively document.getElementById("row1").style.backgroundColor = '#ccc'.
webspeeder — 2008-05-05T09:42:48-04:00 — #3
So that means I'd have to disable each element "manually", right?
jimbo_dk — 2008-05-05T09:45:29-04:00 — #4
If by that you mean give it the appearance of being disabled, then yes. You just need to change the style.
pepejeria — 2008-05-06T05:35:28-04:00 — #5
IE also allows you to set the disabled attribute on other elements than form elements. You will automatically get this grayed out effect on tables etc. They seem to have implemented this half way though, since a disabled link can still be clicked on etc. The disabled attribute can be handy in a IE only intranet, but use jimbo_dk's solution instead (CSS solution) for a cross-browser solution.