<p>To manually generate multi-option fields like radios, your code would look something like this:</p>

<pre><code>{% set yourFieldHandle = form.get("yourFieldHandle") %}

&lt;label&gt;{{ yourFieldHandle.label }}&lt;/label&gt;
{% for option in yourFieldHandle.options %}
   &lt;div class="radio"&gt;
      &lt;label&gt;
         &lt;input type="radio" name="yourFieldHandle" value="{{ option.value }}" {{ option.checked ? "checked" }} /&gt;
         {{ option.label|raw }}
      &lt;/label&gt;
   &lt;/div&gt;
{% endfor %}
</code></pre>

CC BY-SA 4.0
2018-11-07T22:43:03.493Z
2018-11-07T22:43:03.493Z
Solspace
<p>Using Solspace Freeform, I am trying to hardcode a radio gorup and its options in to a template. My effort is below but its not working</p>

<pre><code>{# get the radio group field #}
{% set interestedIn = form.get("interestedIn") %}
{# Loop through the radio options #}                        
{% for option in interestedIn %}
&lt;input type="radio" id="form-input-{{ interestedIn.handle }}" name="{{ interestedIn.handle }}" value="email"&gt;
&lt;label for="form-input-{{ interestedIn.handle }}"&gt;Email&lt;/label&gt;
{% endfor %}
</code></pre>

<plugin-freeform><solspace><freeform>
Solspace Freeform: Looping through Radio group options in template
# Solspace Freeform: Looping through Radio group options in template

(Asked by: username_0 on 2018-11-06)

Using Solspace Freeform, I am trying to hardcode a radio gorup and its options in to a template. My effort is below but its not working
{# get the radio group field #}
{% set interestedIn = form.get("interestedIn") %}
{# Loop through the radio options #}                        
{% for option in interestedIn %}

Email
{% endfor %}

**Tags:** plugin-freeform, solspace, freeform

---

## 1 answers

### Answer by username_1 on 2018-11-07. Score: 0 | Accepted answer

To manually generate multi-option fields like radios, your code would look something like this:
{% set yourFieldHandle = form.get("yourFieldHandle") %}

{{ yourFieldHandle.label }}
{% for option in yourFieldHandle.options %}
   
      
         
         {{ option.label|raw }}
      
   
{% endfor %}


---

