HighDots Forums  

Why id and name tag have to be the same ??

alt.html.tags alt.html.tags


Discuss Why id and name tag have to be the same ?? in the alt.html.tags forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Fred
 
Posts: n/a

Default Why id and name tag have to be the same ?? - 07-17-2003 , 11:11 AM






Maybe it's just me, but this seems a little silly....

At the top of my page, I have a list of topics and they link to
"bookmarks" later down the page.

My id tags were flagged because they have to be a single token (I
assume that means a single word ....not a phrase). So I change all of
the id's and make sure to update all of the href="# . The next time I
go to validate, I get slammed because the id and name tag have to be
the same.

I don't understand the logic here and I'm also wondering whether, with
certain browsers (or screen readers), this is going to cause a lot of
repetition.

Any comments ? What's the logic here ? (I haven't tried just coding
one or the other...just id or just name...wonder whether that would
have been a timesaver.)

Fred

Reply With Quote
  #2  
Old   
Fred
 
Posts: n/a

Default Re: Why id and name tag have to be the same ?? - 07-17-2003 , 11:13 AM






On Thu, 17 Jul 2003 11:11:42 -0400, Fred <freddielives (AT) hotmail (DOT) com>
wrote:

Quote:
Maybe it's just me, but this seems a little silly....

At the top of my page, I have a list of topics and they link to
"bookmarks" later down the page.

My id tags were flagged because they have to be a single token (I
assume that means a single word ....not a phrase). So I change all of
the id's and make sure to update all of the href="# . The next time I
go to validate, I get slammed because the id and name tag have to be
the same.

I don't understand the logic here and I'm also wondering whether, with
certain browsers (or screen readers), this is going to cause a lot of
repetition.

Any comments ? What's the logic here ? (I haven't tried just coding
one or the other...just id or just name...wonder whether that would
have been a timesaver.)

Fred
Sorry...maybe this is a moot point...but I failed to mention that
name= validates when coded with multiple words.

Fred


Reply With Quote
  #3  
Old   
Fred
 
Posts: n/a

Default Re: Why id and name tag have to be the same ?? - 07-17-2003 , 12:20 PM



On Thu, 17 Jul 2003 15:43:46 +0000 (UTC), wizard <wiz (AT) wiz (DOT) wiz> wrote:

Quote:
Fred <freddielives (AT) hotmail (DOT) com> wrote:
On Thu, 17 Jul 2003 11:11:42 -0400, Fred <freddielives (AT) hotmail (DOT) com
wrote:

Maybe it's just me, but this seems a little silly....

At the top of my page, I have a list of topics and they link to
"bookmarks" later down the page.

My id tags were flagged because they have to be a single token (I
assume that means a single word ....not a phrase). So I change all of
the id's and make sure to update all of the href="# . The next time I
go to validate, I get slammed because the id and name tag have to be
the same.

I don't understand the logic here and I'm also wondering whether, with
certain browsers (or screen readers), this is going to cause a lot of
repetition.

Any comments ? What's the logic here ? (I haven't tried just coding
one or the other...just id or just name...wonder whether that would
have been a timesaver.)

Fred

Sorry...maybe this is a moot point...but I failed to mention that
name= validates when coded with multiple words.

Fred

URL?
I would love to provide the URL. However, my boss would have a
coniption fit !! He is extremely "Internet paranoid". I have pretty
much signed my life away, swearing that I won't mention our site name
on any online forum. (Sucks? Yes, big time !)

I thought this was something that could be addressed simply from the
description I've provided and someone else's practical experience.

Thanks anyhow !

Fred



Reply With Quote
  #4  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Why id and name tag have to be the same ?? - 07-17-2003 , 01:51 PM



Fred <freddielives (AT) hotmail (DOT) com> wrote:

Quote:
I thought this was something that could be addressed simply from the
description I've provided and someone else's practical experience.
You were wrong. There's some fundamental confusion in your approach,
but we cannot see it. If you cannot reveal real URLs, try to set up a
simplified demo that you can publish.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html




Reply With Quote
  #5  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Why id and name tag have to be the same ?? - 07-18-2003 , 01:18 AM



"Ernest Cline" <ernestcline (AT) mindspring (DOT) communism> wrote:

Quote:
Come now, while for most problems a real URL is needed, the basic
question is simple enough to be answered without needing one.
No, it is not. This becomes obvious, if you read the OP's messages. The
crystal ball suggests that the _real_ problem may have something to do
with the format of attribute values.

The id attribute is declared so that its value shall consist of name
characters only, with a letter as the first character. There's no way
around this without changing the HTML definition. In name attributes,
more flexibility is allowed, but when name attributes are used for
anchors, it's unwise to use other than name characters. One reason to
this is that it is unclear what should happen to spaces. Generally, a
space in a URL must be URL encoded, but there's confusion as regards to
fragments, i.e. whether you should have href="#foo bar" or
href="#foo%20bar" when referring to an anchor set up by
<a name="foo bar">...</a>.

But it's rather boring to keep guessing such things when a simple demo
would make things clear - preferably with the URL posted in the first
question.

Quote:
The simple answer is that when the id attribute and the name
attribute are both used on the same anchor element they must have
the same value.
The OP already knew this.

Quote:
As for why this is so, here is the explanation.
Which is quite unnecessary if and when the real question was something
completely different. Your history is essentially wrong, too. The real
reason for the confusion is that the original designers of HTML didn't
know SGML well enough and therefore didn't realize that an ID declared
attribute is needed for a purpose like linking. (Whether its _name_ is
"id" is irrelevant.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.