id summary reporter owner description type status priority milestone component version resolution keywords cc blockedby blocking
6665 Using htmlFor vs. for as an attribute getter/setter jgarfield Becky Gibson "I noticed when working with the latest Editor code in Internet Explorer, the labels for 'Font Size' and 'Font Name' (when using the FontChoice.js Plugin) don't have their tags closed, nor do they have ids associated with them.
Further investigating this, the line that was the culprit in this Plugin was the following in the setToolbar function:
{{{
label.setAttribute(""for"", forRef.id);
}}}
I found that in Internet Explorer (''you may want to test more browsers than those that I covered''), you must use 'htmlFor' instead of 'for' for the setAttribute/getAttribute call. Same goes for class vs. className.
Currently dojo.attr() only looks at tabIndex vs. tabindex for Internet Explorer. I think we should also add another case to _fixAttrName for 'for' -> 'htmlFor' and 'class' -> 'className'. The Plugin in question should also probably use dojo.attr() as well to make use of its corrections.
'''This also affects dojo.query!
{{{
dojo.query([for=""blah""]);
}}}
versus
{{{
dojo.query([htmlFor=""blah""]);
}}}
I tested the following browsers to see which ones would/wouldn't accept for and/or htmlFor, and these are the results...
IE8 - Uses htmlFor[[BR]]
IE7 - Uses htmlFor[[BR]]
IE6 - Uses htmlFor[[BR]]
[[BR]]
FF3 (PC) - Uses for[[BR]]
FF2 (PC) - Uses for[[BR]]
FF1.5 (PC) - Uses for[[BR]]
Opera9 (PC) - Uses for[[BR]]
Mozilla 1.8 (PC) - Uses for[[BR]]
Safari 3.0 (PC) - Uses for[[BR]]
Safari 3.1 (PC) - Uses for[[BR]]
Netscape 7.2 (PC) - Uses for[[BR]]
Netscape 8.1 (PC) - Uses for[[BR]]
" defect closed high 1.2 Dijit 1.1.0 fixed