Populate drop down from List Field

5 posts by 4 authors in: Forums > CMS Builder
Last Post: April 5, 2010   (RSS)

Hi,

I have a list field for a section containing t-shirt sizes. (mutli-selection check boxes)
<?php echo join(',', getListLabels('merchandise', 'size', $merchandiseRecord['size'])); ?>

But instead of displaying the sizes( ex. S, M, L, XL ...like the above code will do)

I want them to be in a drop down list for people to select what size they want..

I know this isnt right, but something like this (this only displays the first size:

select name="Size">
<option value="Small"><?php echo join('</option>', getListLabels('merchandise', 'size', $merchandiseRecord['size'])); ?>
</select>

Re: [chris] Populate drop down from List Field

perfecto!!

Re: [chris] Populate drop down from List Field

By thenetgirl - April 2, 2010

is there anything you have to put in the page header for this to work????
Patricia

www.thenetgirl.com

Re: [thenetgirl] Populate drop down from List Field

By Donna - April 5, 2010

Hi Patricia!

Nothing specific, but this particular code will only work in a repeating foreach loop (as in a list of items), as opposed to on its own like what you're trying to do. :)
Donna

--
support@interactivetools.com