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.

Specify values of an SAEF pulldown dyamically

January 30, 2011 1:14pm

Subscribe [3]
  • #1 / Jan 30, 2011 1:14pm

    gbederson

    92 posts

    Is there a way to fill in a pulldown in an SAEF using values specified in a template? The values are going to have to be dynamic, so I can’t pre-fill them in the custom field. The following code in the SAEF is displaying correctly, but after submission no values appear in the entry.

    {if pulldown}
    <select id="{field_name}" name="{field_name}">
    <option value="Purpose">Purpose
    <option value="Prices">Prices
    <option value="Employees">Employees
    <option value="{custom1}">{custom1}
    <option value="{custom2}">{custom2}
    <option value="Community">Community
    </select>
    {/if}
  • #2 / Jan 31, 2011 9:36am

    Sue Crocker

    26054 posts

    What are custom1 and custom2? Is this EE1.x or EE2.x? I see you have licenses for both.

  • #3 / Jan 31, 2011 11:40am

    gbederson

    92 posts

    Sue,

    I am using 1.6.9. I just wrote {custom1} to show that I would be putting an EE tag there. It will actually be something like this: {exp:weblog:entries weblog="place"}{if title == "Business"}{review1-title}{/if}{/exp:weblog:entries}

    I simply want members to be able to select an item for a list, which will be entered into a custom field. The problem is that I don’t think I can put those items in the custom field drop-down list, because, as you see, the items are not just words - they are dynamically created by EE tags. Maybe there’s an easier way to do this?

    Thanks,

    Geoff

  • #4 / Feb 01, 2011 4:36am

    John Henry Donovan

    12339 posts

    Geoff,

    yo could use an emebd here if I am picking up what you want to do right.

    {if pulldown}
    <select id="{field_name}" name="{field_name}">
    {embed="template_group/template_to_embed"}
    </select>
    {/if}

    Contents of embedded template

    {exp:weblog:entries weblog="place" dynamic="off"}
    <option value="{title}">{title}
    {/exp:weblog:entries}

    Does that help?

  • #5 / Feb 01, 2011 12:35pm

    gbederson

    92 posts

    John,

    Yes, the embed is useful in getting the values for the drop-down, but that’s not the problem that I’m having. The problem is that it seems that it is not possible to populate a drop-down field using a template - at least, that is what I’m trying and unable to do. Normally of course one enters the values to choose from in the drop-down field in the custom field. I want to be able to do this in the template.

    I am able to submit the form using the code I have, and it does create an entry, but nothing is added to the drop-down field.

    Thanks,

    Geoff

  • #6 / Feb 02, 2011 5:31am

    John Henry Donovan

    12339 posts

    Geoff ,

    I am able to submit the form using the code I have, and it does create an entry, but nothing is added to the drop-down field.

    That won’t be possible I don’t believe. You can certainly use a dropdown on your SAEF to populate a text input for your entry but not select an option from a dropdown field

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

ExpressionEngine News!

#eecms, #events, #releases