Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-07T22:43:03.493Z
Answers.LastActivityDate: 2018-11-07T22:43:03.493Z
Answers.UserDisplayName: Solspace
Body: <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>
  
Tags: <plugin-freeform><solspace><freeform>
Title: Solspace Freeform: Looping through Radio group options in template
ThreadText: # Solspace Freeform: Looping through Radio group options in template
  
  (Asked by: username_0 on 2018-11-06)
  
  Using username_1 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 %}
  <input type="radio" id="form-input-{{ interestedIn.handle }}" name="{{ interestedIn.handle }}" value="email">
  <label for="form-input-{{ interestedIn.handle }}">Email</label>
  {% 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") %}
  
  <label>{{ yourFieldHandle.label }}</label>
  {% for option in yourFieldHandle.options %}
     <div class="radio">
        <label>
           <input type="radio" name="yourFieldHandle" value="{{ option.value }}" {{ option.checked ? "checked" }} />
           {{ option.label|raw }}
        </label>
     </div>
  {% endfor %}
  
  ```
  
  
  ---
  
  