Reply to Re: Heeeeeeeeeeeeeeeeeeeeeelp ! why this programme doesn't work?

Your name:

Reply:


Posted by Kimmo Laine on 12/18/85 11:50

"the DtTvB" <mechakoopa@gmail.com> wrote in message
news:1150292488.961255.63160@f6g2000cwb.googlegroups.com...
> Carl Anatorian wrote:
>> But why does php only pick "name" attribute?
>
> ID's not name, and it won't be sent along with the request, so it's not
> the problem for PHP.
> It's true that the new XHTML stop using name and use id instead, but
> name still be used in inputs, textareas, and buttons.


That's actually quite insane, if you think about radio buttons. more than
one elements may share the same name while their id's must be distinct. Now
if you have a radiobutton group like so:

<input type="radio" name="foo" id="foo_1" value="1">
<input type="radio" name="foo" id="foo_2" value="2">
<input type="radio" name="foo" id="foo_3" value="3">

Traditionally the name is submitted, so in the backend you just check the
value of form-variable named foo and you know what was selected. Now if you
send id instead of name, first you need to go through all the id's to see
which is set, then get the value of it. To me this makes no sense. The name
binds the control group together while the id distincts individual controls.

What's the point again fixing something that isn't broken? Actually breaking
something that works perfectly. I've always thought it like this: id is for
client-side, name is for server side. The id is used with javascripts, like
getElementById when accessing a certain control and binding lables to
controls. The name is what the server side should see, clear and simple.

So what's this new XHTML that is going to destroy a perfectly working
system?

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

[Back to original 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

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