Search code examples
expressionengine

Expression Engine - How do I set the Category to show as dropdown?


I am using a SafeCracker form for data entry on a site and need to be able to display the category selection as a drop down list rather than multi-select.

I have this code here, but my attempts to modify it don't make any difference:

<p>
{category_menu}
    <label for="categories">Choose a category...</label><br />
    <select name="category[]" id="categories" size="4" multiple="single">
            {select_options}
    </select>
{/category_menu}
</p>

What is the correct way to set this to display a drop down list?

Thanks!


Solution

  • I believe this is more of an HTML error. :) there's no such thing as multiple="single"

    Just delete that completely and have:

    <select name="category[]" id="categories" size="4">
    

    Does that help?