You are here: Re: Heeeeeeeeeeeeeeeeeeeeeelp ! why this programme doesn't work? « PHP Programming Language « IT news, forums, messages
Re: Heeeeeeeeeeeeeeeeeeeeeelp ! why this programme doesn't work?

Posted by Markus Ernst on 06/14/06 14:01

Carl Anatorian schrieb:
[...]
>> Because PHP picks "name" attribute, not "id" attribute. Try with this:
[...]
>>
> thank you very much !!!!!!
> But why does php only pick "name" attribute?

These attributes have quite different meanings: name is for the key of
form submissions, while id is for DOM access, and has more restrictive
naming rules, and must be unique. These restrictions are not applicable
for the name attribute. These are valid:

<input type="radio" name="option" value="0">
<input type="radio" name="option" value="1">

<input type="checkbox" name="choice[]" value="0">
<input type="checkbox" name="choice[]" value="1">

<input type="text" name="friends[]" value="Tina">
<input type="text" name="friends[]" value="Ike">

While they all would cause validation errors if id was used instead of
name. Also stuff like getElementById("option") would not work if id was
not unique.

--
Markus

 

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

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