1

I have a select menu where the values are loaded from a channel field. Is it possible to set the sort order using Freeform Pro? The code below does not work and I have not found any documentation. Surely though there must be a way to sort the contents of a select menu loaded from a channel by something other than entry_id.

           {freeform:field:field_001
            attr:id="493"
            attr:class="form-control"
            attr:orderby="title"
            attr:sort="asc"} 

I also tried this code below but obviously the data would not submit.

        <p><label for="field_001">First Choice</label><span class="required">* </span><br />   
            <select name="field_001" class="form-control" id="dd_biology_reu_faculty_001">
                <option value="">Select</option>
                {exp:channel:entries channel="channel_name" orderby="title" sort="asc" dynamic="no"}                    
                    <option value="{entry_id}|~|{title}">{title}</option>
                {/exp:channel:entries}
            </select> </p>  

Thanks in advance.

1 Answer 1

1

Chalk this one up to "Operator Error!"

This code worked:

    <p><label for="field_001">First Choice:</label><span class="required">* </span><br />       
    <select name="field_001" class="form-control" id="field_001">
        <option value="">Select</option>
                {exp:channel:entries channel="channel_field" orderby="title" sort="asc" dynamic="no"}                    
                    <option value="{title}">{title}</option>
                {/exp:channel:entries}
            </select> </p>
1
  • If this answer isn't the solution, please delete it. I also deleted your other answer post since it's not an answer.
    – Anna_MediaGirl
    May 17, 2014 at 3:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.