Argh... I wonder what part of "This name [the ID] must be unique in a document" 
your PHP developers do not understand?

http://www.w3.org/TR/html401/struct/global.html#adef-id

(I should ask their forgiveness for putting it so rudely, but really, this is 
something that is just Not Done.)

What is document.getElementById('foo') supposed to do when there are two 
elements with id="foo"? There's a reason it says "Element"
and not "Elements".

Are they unwilling to use classnames? Either classnames or *unique* IDs are the 
right solution. If they like to use IDs, they can
generate unique IDs on the fly for these page elements.

If you could give an example of how they use the duplicate IDs, someone can 
probably suggest another way to do it.

-Mike

> From: Collin Allen
> 
> The purpose of classes is for styles/behaviors/identifiers 
> that are spread across multiple occurrences of an item.  
> (Full detail: I'm working on this project with some PHP 
> engineers at work, and they're completely OK with using 
> multiple DOM IDs on a page simply because "it works" already, 
> and they can access the IDs by being more specific like 
> "#area1 #service1" in their JavaScript hooks).  Going 
> "classes- only" with re-usable Services would work, but for 
> some elements, an ID becomes more important.  Case in point: 
> input text boxes.  Generally, they have a name and ID, but if 
> two Services are loaded with the same content, the IDs 
> overlap -- and who knows what will break.
> 
> I'm against using duplicate IDs on any page just because I 
> learned the W3C standards and what's good practice and what's 
> not.  Aside from using classes as semi-unique identifiers, I 
> can't see a way around the dilemma...

Reply via email to