1

I am populating a select drop down with custom options in the template, but those options are not being displayed in the individual Form submission page.

Example code below:

{% if field.handle == "country" %}            
<div class="fe {{ columnClass }}">
   <label class="select-label">
      <select name="{{ field.handle }}" id="form-input-{{ field.handle }}" required>
          <option value="">Country *</option>
          <option value="AF">Afghanistan</option>
          <option value="xx">another country...</option>
    </label>
</div>
{% endif %}

The Country field handle is country

Outputted html is:

<div class="fe freeform-column  freeform-column-6">
    <label class="select-label">
        <select name="country" id="form-input-country" required>
            <option value="">Country *</option>
            <option value="AF">Afghanistan</option>
            <option value="xx">Another country...</option>
        </select>
    </label>
</div> 

When I view the individual submission in admin I see the below: Form submission page

But in the submission list page the value does appear:

Submissions List

Thanks

1

Unfortunately this is currently a limitation of Freeform. It expects that the option values are predefined for the field, and not dynamically loaded at template level.

It's on our feature requests list to come up with a way to let users override this functionality. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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