Re: comments on input form

Dave_Raggett (dsr@hplb.hpl.hp.com)
Tue, 12 Oct 93 16:01:53 BST


Pei Wei writes:

> I'd suggest adding ID/NAME to these <LI>'s so it will not be
> necessary to have to use list data to identify the selection.
> But as convention, browsers may still simply use the list content
> if no NAMEs are specified.

> The point is to be able to do something like this, where you
> want to get back a simple selection identifier (ie "coke"), and not
> the actual whatever is marked in the list:

> <SELECT NAME="directions">
> <LI NAME="7up"><ICON SRC="7up">Seven Up.
> <LI NAME="coke"><ICON SRC="coke">Coke Cola
> </SELECT>

I omitted the details in my message, but assumed it would work in the same
way as other INPUT fields. That is the NAME attribute for the SELECT element
applies to the list items, and that these need a VALUE attribute, e.g.

<SELECT NAME="directions">
<LI VALUE="7up" CHECKED SRC="7up.gif">
<LI VALUE="coke" SRC="coke.gif">
</SELECT>

This also shows how the CHECKED attribute can be used to set the initial
selection(s), and the use of the SRC attribute for iconic list items. The
latter is borrowed from the use of LI with bulleted lists, where you can
substitute an icon for a bullet symbol.

Dave