ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to setup editable select / drop down menu?

February 14, 2008 1:06pm

Subscribe [3]
  • #1 / Feb 14, 2008 1:06pm

    EasyThereTiger

    36 posts

    Hey there,

    My client would like me to setup a select menu where they can edit the options. This is going to be used on a “How did you hear about us?” form question, and they would like to have access to changing the answers when needed.

    Looking for pointers on how to approach this.
    Thanks for your help!
    easytheretiger

  • #2 / Feb 14, 2008 1:18pm

    Cocoaholic

    445 posts

    I would also like to hear how other EE users have done this.

    I recently threw something together using a custom field to hold the options, and a modified version of the “list maker” plugin.
    Instead of list items (<li>bla</li>) the plugin now generates options (<option value=“bla”>bla</option>).

    The formatting for the custom field is set to “none”.

    {exp:weblog:entries weblog="training" limit="1" dynamic="off" entry_id="22" disable="category_fields|categories|member_data|pagination|trackbacks"}
    
    <select name="whatever">
    {exp:list_maker_options}
    {options_custom_field}
    {/exp:list_maker_options}
    </select>
    
    {/exp:weblog:entries}

    Since I didn’t write the plugin I won’t post it here, but if you want it just PM me.

    EDIT: changed the code to include the <select> tag.

  • #3 / Feb 14, 2008 4:31pm

    EasyThereTiger

    36 posts

    The only way I could think of doing this was by creating another weblog and custom field group:

    <select>
    <option value="">-- Please Select --</option>
    {exp:weblog:entries weblog="hearabout" orderby="andDesc" sort="asc" disable="categories|member_data|pagination|trackbacks"}
    <option value="{ansValue}">{ansDesc}</option>
    {/exp:weblog:entries}
    <option value="Other">Other</option>
    </select>

    Works nicely.

  • #4 / Mar 11, 2008 11:06am

    elemental

    77 posts

    EDIT: wrong therad, delete this. Thnx

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases