Topic awaiting preservation: SPAN disabled=false not applying |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: Perth Western Australia |
posted 06-19-2004 21:16
msdn.microsoft.com specifies that a SPAN element has no disable attribute. But when you specify disabled=false the span is disabled. (obviously the same occurs when set to true.) code: incorrect:
|
Paranoid (IV) Inmate From: A graveyard of dreams |
posted 06-19-2004 22:03
The msdn site is correct, the span-tag doesn't have a disable attribute... What do you want to accomplish? |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 06-19-2004 22:06
The "disabled" attribute (which is not a standard attribute) doesn't work by setting it to false or true. Rather, it's one of those attributes which, when included, takes effect, and when not, doesn't take effect. In HTML 4, they're meant to be used like this: |
Nervous Wreck (II) Inmate From: Perth Western Australia |
posted 06-19-2004 22:42
hmmm. |
Paranoid (IV) Inmate From: A graveyard of dreams |
posted 06-20-2004 14:09
Why not use the 'display' property? It is standard comilant and works for all browsers. Set it to 'none' to remove the item and to 'block' or 'inline' to display the item. Since it is a standard CSS property it is also easy to manipulate using JavaScript... |
Paranoid (IV) Inmate From: France |
posted 06-20-2004 14:46
Another option you may take is to display a low opacity image ( or 2x2 dithered image ) above the SPANs you want to disable. Whatever you do, if you don't disable the form fields or links by a magical-non-standard property, you'll have to trap the onfocus events of the children element of the disabled SPANs to prevent advanced user from accessing active elements inside them. |
Nervous Wreck (II) Inmate From: Perth Western Australia |
posted 06-20-2004 16:03
Thanks, all valid suggestions. There are a million ways to do it, images, display:none etc.... but the 'most' simple method for the current design is to have the disabled property in the HTML tag. Since that is not really suitable (having the effect of always disabling the span) I'll rewrite the logic and find another approach to initializing the spans enabled or disabled. Oh, and not displaying them serves no purpose. I merely want to show they are not able to be used at one moment or another. Also, removing them via no display does not solve the overall logical problems. |
Paranoid (IV) Inmate From: France |
posted 06-20-2004 16:15
To show that the active elements ( links, form fields ... ) are disabled, you could also decrease the opacity of their parent SPAN. I think your problem would have been a good entry for the May 20lines Javascript contest - Enhancing markup And, from the infos you gave, I think it could fit in the 20 lines constraint. |