You are here: Re: HTML Twins « HTML « IT news, forums, messages
Re: HTML Twins

Posted by Brian Staff on 11/29/05 17:16

> (1) Can two HTML controls have the same name? It looks like the obvious
> answer is NO.

Yes they can, for instance, two radio buttons can (should) have the same NAME but
they must (should) have a unique ID.


> (2) What if? What if the developer has given two HTML controls the same
> name, i.e has created the same button more than once with exactly the
> same name and all other attributes? What happens then?

The NAME is only used when a FORM and its child controls are sent back to the
server. The server identifies each control thru its NAME. If the server is not
interested in the value(s) of the controls with the same name, then it does not
matter.

JavaScript on the client-side though typically uses the ID (which should be
unique), but if an ID is not specified, then it will use the NAME.

Brian

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация