You are here: Re: HTML and PHP question (not assinging any value) « PHP Programming Language « IT news, forums, messages
Re: HTML and PHP question (not assinging any value)

Posted by Tim Roberts on 06/20/06 05:03

"Roy W. Andersen" <roy-news@netgoth.org> wrote:

>amit wrote:
>> <select name=selected_group>
>> <option> Gropu 1</option>
>> <option> Group 2</option>
>> and ...
>> </select>
>
>Each option needs to have a value assigned. The text between <option>
>and </option> is only visual and is not used for the actual form-data
>when submitting it to the server. Hence, the code quoted above will
>submit an empty value for "selected_group" regardless of what's actually
>selected.

Bzzzt, sorry, this is incorrect. If no "value" clause is specified, the
text between <option> and </option> becomes the value for that item.

>This is how you should do it:
>
><select name="selected_group">
> <option value="Group 1">Group 1</option>
> <option value="Group 2">Group 2</option>
></select>
>
>This way, when the form is submitted, what you've defined in the
>value-parameter is what is actually sent to the server.

Nope. The "value" clauses in your example are entirely unnecessary.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

 

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

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