RE: NAME or ID ?

James Craig <james_craig@Powered.com> wrote:

> ('id' doesn't work correctly in netscape 4)...

As an anchor, no it doesn't. It's fine for identifying things to CSS and
in document.layers though.

> also, some server side languages (php, for example)
> will not catch form variables if they are listed with the
> 'id' attribute.

This is to do with the browser, not the server-side scripting language.
Confronted with:

  <input type="text" id="foo" value="bar">

Browsers do not and should not submit "foo=bar" to a script. 'name' is
still used here for form control names; 'id' has a different meaning.

> so in theory, 'name' is deprecated and should not be used. 

Only the identifying uses of 'name' such as <a> and <img>. This usage of
'name' to identify a particular part of the page is now superceded by
the 'id' attribute, which can occur on any element.

<meta name>, <param name> and <input|select|textarea|button|object name>
are entirely unrelated and should still be used. Hopefully the
separation of the identifying-uses from other uses of 'name' may reduce
confusion, when older browsers like N4 disappear.

-- 
Andrew Clover
Technical Consultant
1VALUE.com AG

Received on Tuesday, 18 September 2001 14:18:18 UTC