views:

55

answers:

1

Hi everybody.

I've stumpled upon a strange behavior in IE(6/7/8) that drives me nuts. Given the following markup:

<input type="text" value="foo" class="bar" cache="yes" send="no" />

Please note that the cache attribute is set to yes. However IE somehow manages to change the attributes value to cache="cache" when rendering the DOM.

So, I wonder, is there an undocumented feature that I'm not aware of? I've googled about an hour now but couldn't find any info on this (not even on MSDN).

NOTE
I'm aware that adding custom attributes is non-standard compliant and that boolean attributes should be noted as attribute="attribute. Nevertheless I have to cope with these as they were introduced long before I joined the team. These custom attributes are used in conjunction with javascript to provide a more user friendly approach to form handling (and it works out quite well with Firefox/Safari/Opera/Chrome).

I know that I could simply convert these custom attributes to x-data attributes that will be introduced with HTML5 but that would take me several hours of extra work - sigh.

Hope, I made myself clear. Thanks in advance.

A: 

For ages, it has been that boolean attributes are preferrably written as <input type="checkbox" checked="checked"/> etc. This is because in the dinosaur age, you were supposed to only write <input type="checkbox" checked/> and assigning the same value as the property name broke the fewest legacy browsers, while still making the markup XML-compliant.

erikkallen
As i wrote, I'm aware of this legacy issue. The thing is IE won't break the "send" attribute.
aefxx
If you say that, I recommend you rephrase, because I have read your question twice more now and still can't see where you say that. How do you read the attribute value?
erikkallen
You're right, I didn't mention it explicitly - I'll edit the post.
aefxx