Populate drop down from List Field

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

Re: [s2smedia] Populate drop down from List Field

By Chris - February 18, 2010 - edited: February 18, 2010

Hi s2smedia,

How about this?

<select name="Size">
<?php $options = getListLabels('merchandise', 'size', $merchandiseRecord['size']) ?>
<?php foreach($options as $option): ?>
<option><?php echo htmlspecialchars($option) ?></option>
<?php endforeach ?>
</select>


I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Populate drop down from List Field

By s2smedia - February 18, 2010

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