Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- options list please
May 8, 2006, 7:13 pm
rate this thread
hi there, i am trying to build an option list using the following code
<option value="<Computed Value>"><Computed Value></option>
the "Computed Value" items are both text lists containing options to be
selected and is dynamically created from a database, they would contain
for example "Small,Medium,Large,Extra Large" as labels and strings.
any idea how i could make this work, is there an "option list" for
example rather than "option value"
Re: options list please
You use a server-side processor like PHP, JSP or ASP. It retrieves a
data set from the database, iterates through the set outputting one
<option> per result.
If the the data is a text list, use functions to separate the options.
- Query database for size options (or parse the string)
- output <select name="size-options">
- for each size
$sizedata = next query result
output <option value="$sizedata">$sizedata</option>
- output </select>
For the example above you have four options.
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)