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.

Channel Entry form - Using elect drop downs from a grid field

July 28, 2014 4:32pm

Subscribe [1]
  • #1 / Jul 28, 2014 4:32pm

    eigotec

    19 posts

    Hi,

    I’m making a channel entry form which should add data to a grid field.

    The documentation is pretty straight forward…

    <select id="{field_name}" name="{field_name}">
          {options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
    </select>

    Field name i can handle, but what goes in the option_value, selected and option_name?

    Also as i’m using a grid field, would i lay this out the same way i would with normal channel entries tag? i.e

    {exp:channel:entries channel="news"}
    {grid_field_name}
        <h2>{title}</h2>
    <p>    {body}<br />
    {/grid_field_name}<br />
    {/exp:channel:entries}

    Thanks.

  • #2 / Aug 11, 2014 5:48am

    eigotec

    19 posts

    Can anyone give an example of an entry form which uses a grid field? Still struggling with this.

  • #3 / Aug 11, 2014 5:50am

    eigotec

    19 posts

    At the moment, the dropdown options stay as {option_name} rather than generating a drop down list from the channel.

  • #4 / Aug 11, 2014 8:57am

    eigotec

    19 posts

    Ok, so it turns out this was ridiculously simple.

    Rather than having to find add the fields myself, one by one I just had to add:

    {field:grid_field_name}

    Hope that helps. Didn’t see it in the documentation anywhere.

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

ExpressionEngine News!

#eecms, #events, #releases