Id vs. Name and IE PC
I finally sussed out why readers of this site using Internet Explorer PC could not comment or communicate. Upon submitting a form they were being told to enter a name despite having already done so. Apparently IE PC (forever the boon of the careless, lazy coder) uses the name
and id
attributes interchangeably. My client-side validation script makes sure that <input id="author">
has a value before submitting the form by using document.getElementById('author').value
to access that value.
The HTML validated; all the tags were properly nested. No problems in any other browser. I disabled all other scripts that were running on the page thinking maybe one of them was invalidating the page at run time—my Flash image replacement script in particular because it adds and removes elements from the document tree.
It wasn’t until I removed all my head tags that I discovered the source of the problem. IE PC was finding this, <meta name="author" content="Shaun Inman">
instead of the <input>
tag. Technically, both the name
and id
attributes should be unique (the <meta>
tags were a last minute addition) but is the function name not getElementById()
?
003 Comments
Has anybody else noticed that Safari 1.2 (possibly older versions too) adds a single space after all inline elements? The bug appears twice in the post above. After the communicate link and the italicized portion of getElementById before the parentheses. And then again, a third time, before the final question mark following the <code> block.
First Microsoft, now Apple—who else wants on my list? ;D
Hmm, no space with firebird but I did get a fouc! Weird, I was ‘low on bandwidth at the time’ but yer page came up ‘neked’!
Zoinks! I never noticed that ‘instant’ preview last time I was here. Uber-cool.
Yeah. This is not the only problem with IE, There are far too many to list here, even after the source code has been slipped ;)