On Fri, 2003-03-07 at 09:34, John Taylor-Johnston wrote:
> I have an *.inc with html, a rather long list of <options>. 

And you want to print out said list of OPTIONs several times with
different ones selected each time?

You could do it with an array and a function. The array would contain a
list of keys and data (e.g. array ("key" => "data")) where the keys
would be the values for the option elements, and the data would be the
labels (i.e. what's between the option start tag and end tag).

The function would build the select by looping through the array and
printing out the option elements. By comparing each key with a parameter
you passed in to the function, it would know which option element to
give the selected attribute to.

Give it a try, and if you have any difficulty, look at:

http://nikmakepeace.com/goodies/help/selectbuilder.php (.phps available)

Nik


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to