<p>A little messy but here's how I got it to work in case anyone else has this question. It even seems to respect the conditional display rules on my form.</p>

<pre><code>{% if form|length %}
    {{ form.renderTag }}

    {% if form.hasErrors %}
      &lt;div class="freeform-form-has-errors"&gt;
        {{ "Error! Please review the form and try submitting again."|t('freeform') }}

        {% if form.errors|length %}
          &lt;ul&gt;
            {% for error in form.errors %}
              &lt;li&gt;{{ error }}&lt;/li&gt;
            {% endfor %}
          &lt;/ul&gt;
        {% endif %}
      &lt;/div&gt;
    {% endif %}

    {% for row in form %}
      &lt;div class="freeform-row {{ form.customAttributes.rowClass }}"&gt;
        {% for field in row %}
          {% set columnClass = "freeform-column " ~ form.customAttributes.columnClass %}
          {% if field.type == "submit" %}
            {% set columnClass = columnClass ~ " freeform-column-content-align-" ~ field.position %}
          {% endif %}
          {% if field.type == "radio_group" %}
            &lt;div class="{{ columnClass }}"{{ field.rulesHtmlData }}&gt;
                {{ field.renderLabel() }}
                &lt;div class="freeform-instructions"&gt;
                 {{ field.renderInstructions() }}
                &lt;/div&gt;
                {% if field.errors %}
                &lt;ul class="errors freeform-errors"&gt;
                    {% for error in field.errors %}
                        &lt;li&gt;{{ error }}&lt;/li&gt;
                    {% endfor %}
                &lt;/ul&gt;
                {% endif %}
                {% for option in field.options %}
                    &lt;label&gt;
                        &lt;input type="radio" class="freeform-input" 
                          name="{{ field.handle }}" type="radio" 
                          id="form-input-{{ field.handle }}-{{ loop.index }}" 
                          value="{{ option.value }}" 
                          {{ option.value == submittedValues[field.handle] ? 'checked' : '' }}&gt;
                        {{ option.label }}
                    &lt;/label&gt;
                {% endfor %}
            &lt;/div&gt;
          {% else %}
          &lt;div class="{{ columnClass }}"{{ field.rulesHtmlData }}&gt;
            {{ field.render({
              class: field.type != "submit" ? "freeform-input" : "",
              labelClass: "freeform-label" ~ (field.inputOnly ? " freeform-input-only-label" : "") ~ (field.required ? " freeform-required" : ""),
              errorClass: "freeform-errors",
              instructionsClass: "freeform-instructions",
              overrideValue: field.handle ? submittedValues[field.handle] : ''
            }) }}
          &lt;/div&gt;
          {% endif %}
        {% endfor %}
      &lt;/div&gt;
    {% endfor %}
    &lt;input type="hidden" name="statusId" value="2"&gt;
    &lt;input type="hidden" name="submissionId" value="{{ application.id }}"&gt;
    &lt;input type="hidden" name="userId" value="{{ currentUser.id }}"&gt;
    &lt;input type="hidden" name="userEmail" value="{{ currentUser.email }}"&gt;
    {{ form.renderClosingTag }}
    {% endif %}

{% js %}
    var act = document.getElementsByName('action');
    act[0].value = 'freeform/submissions/save'
{% endjs %}
</code></pre>

CC BY-SA 4.0
2019-02-14T15:07:10.447Z
2019-02-14T15:07:10.447Z
Mike Graham
<p>I've been able to repopulate text fields this way, but the radio buttons remain unchecked even when there was a value submitted.</p>

<pre><code>{% for field in application.fieldMetaData %}
    {% set submittedValues = submittedValues|merge({ (field.handle): attribute(application, field.handle).value}) %}
{% endfor %}

{% if form|length %}
    {{ craft.freeform.form(form.handle, {
      returnUrl: '/',
      overrideValues: submittedValues
    }).render() }}
{% endif %}
</code></pre>

CC BY-SA 4.0
2019-02-12T23:02:26.483Z
I've discovered that this is not possible. You have to use manual form rendering to do this.
Mike Graham
CC BY-SA 4.0
2019-02-13T23:12:37.820Z
Glad you found a solution... would you mind adding it as an official answer in case it ends up helping someone in the future?
Brad Bell
<plugin-freeform><solspace>
Is it possible to repopulate radio button inputs with values from submission.fieldMetaData using the standard form.render() method?
# Is it possible to repopulate radio button inputs with values from submission.fieldMetaData using the standard form.render() method?

(Asked by: username_0 on 2019-02-11)

I've been able to repopulate text fields this way, but the radio buttons remain unchecked even when there was a value submitted.
{% for field in application.fieldMetaData %}
    {% set submittedValues = submittedValues|merge({ (field.handle): attribute(application, field.handle).value}) %}
{% endfor %}

{% if form|length %}
    {{ craft.freeform.form(form.handle, {
      returnUrl: '/',
      overrideValues: submittedValues
    }).render() }}
{% endif %}

**Tags:** plugin-freeform, solspace

> **Comments:**
> **username_0**: I've discovered that this is not possible. You have to use manual form rendering to do this.  
> **username_1**: Glad you found a solution... would you mind adding it as an official answer in case it ends up helping someone in the future?  

---

## 1 answers

### Answer by username_0 on 2019-02-14. Score: 1 | Accepted answer

A little messy but here's how I got it to work in case anyone else has this question. It even seems to respect the conditional display rules on my form.
{% if form|length %}
    {{ form.renderTag }}

    {% if form.hasErrors %}
      
        {{ "Error! Please review the form and try submitting again."|t('freeform') }}

        {% if form.errors|length %}
          
            {% for error in form.errors %}
              {{ error }}
            {% endfor %}
          
        {% endif %}
      
    {% endif %}

    {% for row in form %}
      
        {% for field in row %}
          {% set columnClass = "freeform-column " ~ form.customAttributes.columnClass %}
          {% if field.type == "submit" %}
            {% set columnClass = columnClass ~ " freeform-column-content-align-" ~ field.position %}
          {% endif %}
          {% if field.type == "radio_group" %}
            
                {{ field.renderLabel() }}
                
                 {{ field.renderInstructions() }}
                
                {% if field.errors %}
                
                    {% for error in field.errors %}
                        {{ error }}
                    {% endfor %}
                
                {% endif %}
                {% for option in field.options %}
                    
                        
                        {{ option.label }}
                    
                {% endfor %}
            
          {% else %}
          
            {{ field.render({
              class: field.type != "submit" ? "freeform-input" : "",
              labelClass: "freeform-label" ~ (field.inputOnly ? " freeform-input-only-label" : "") ~ (field.required ? " freeform-required" : ""),
              errorClass: "freeform-errors",
              instructionsClass: "freeform-instructions",
              overrideValue: field.handle ? submittedValues[field.handle] : ''
            }) }}
          
          {% endif %}
        {% endfor %}
      
    {% endfor %}
    
    
    
    
    {{ form.renderClosingTag }}
    {% endif %}

{% js %}
    var act = document.getElementsByName('action');
    act[0].value = 'freeform/submissions/save'
{% endjs %}


---

