|
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]
|