Hello,
I apologize in advance if this question have been already asked but I could not find it.
My goal is to pre-populate a drop-down list to be used in a search form with values from a custom field. In the following example I try to pre-populate the drop down list with existing cities which has been already entered into a channel and specific custom field.
<select id=“ville” name=“search:ville”>
<option value=”“>Toute</option>
{exp:channel:entries channel="biens"}
<option value=”{ville}”>{ville}</option>
{/exp:channel:entries}
</select>
(ville = city) btw
This actually works, except for one very annoying thing. The list is populated with All entries of the custom field, even when they is more than one time a city. I would like to get only the uniques (distinct) values in order for a visitor to select possible cities in the DB but only see once each city in the list.
I really hope somebody could help me on this issue.
Thank you in advance,
Steven