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