title: django: Query regarding radio buttons
body: <p>The requirement is that I have a set of questions, and I want the responses to be provided by selecting a value which is rendered using radio buttons. The issue here is, say, we have:</p>
  <blockquote>
  <p>Question 1:</p>
  <ul>
  <li>o option 1</li>
  <li>x option 2</li>
  <li>o option 3</li>
  </ul>
  <p>Question 2:</p>
  <ul>
  <li>o option 1</li>
  <li>o option 2</li>
  <li>o option 3</li>
  </ul>
  </blockquote>
  <p>where 'o' represents un-selected options and 'x' - represents an option that has been selected. Now, when trying to check option3 under question 2 it unselects the response to the previous question i.e., Question1.</p>
  <blockquote>
  <p>Question 1:</p>
  <ul>
  <li>o option 1</li>
  <li>o option 2</li>
  <li>o option 3</li>
  </ul>
  <p>Question 2:</p>
  <ul>
  <li>o option 1</li>
  <li>o option 2</li>
  <li>x option 3</li>
  </ul>
  </blockquote>
  <p>How do we decouple the radio button responses for each field??
  Any help would be appreciated. Thanks!!</p>
  <p>Update:
  Here is a small snippet of the template file:</p>
  <pre><code>&lt;h3&gt; Test Form &lt;/h3&gt;
  &lt;hr&gt;
  &lt;div class=&quot;ui center aligned basic very padded segment&quot;&gt;&lt;/div&gt;
  &lt;form method=&quot;post&quot;&gt;
      {% csrf_token %}
      {{ formset.management_form }}
      {% if user.username == 'admin' %}
      &lt;div class=&quot;field {% if field.errors %}error{% endif %}&quot;&gt;
          &lt;b&gt; User Name: &lt;/b&gt; {{ form.user }}
      &lt;/div&gt;
      {% endif %}
      {% for question in questions %} 
      &lt;div class=&quot;ui basic padded segment left aligned&quot;&gt;
          &lt;div class=&quot;ui form {% if form.errors %}error{% endif %}&quot;&gt;
              &lt;h4 class=&quot;ui header&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    Question {{ forloop.counter }}: {{ question.description }} --&gt;
                  &lt;/div&gt;
              &lt;/h4&gt;
              {% for field in form %}
                  {% if field.name == 'level' %}
                      &lt;span class=&quot;field {% if field.errors %}error{% endif %}&quot;&gt;
                      {% for x in field %}
                          &lt;label for=&quot;level_{{question.id}}&quot;&gt;Level&lt;/label&gt;
                          &lt;input type=&quot;radio&quot; class=&quot;rb&quot; name=&quot;{{question.id}}&quot; id=&quot;level_{{question.id}}&quot;&gt; {{ x.data.label }}
                      {%endfor%}
                      &lt;/span&gt;
                  {% endif %}
              {% endfor %}
          &lt;/div&gt;
      &lt;/div&gt;
      {% endfor %}
      &lt;div&gt;
          &lt;button class=&quot;primary&quot; type=&quot;submit&quot; &gt;Submit&lt;/button&gt;
          &lt;button class=&quot;primary&quot; type=&quot;submit&quot; href=&quot;{{ request.META.HTTP_REFERER|escape }}&quot;&gt;Back&lt;/button&gt;
          &lt;input type=&quot;button&quot; value=&quot;Reset&quot; id=&quot;resetBtn&quot; onClick=&quot;this.form.reset()&quot; /&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt; 
  </code></pre>
  <p>Now this displays the form alright. But when trying to access the form data on submission, the question and level details aren't obtained
  On printing the request.POST o/p this is what I see:</p>
  <pre><code>&lt;QueryDict: {'csrfmiddlewaretoken': ['KKNoS7d52vUcMWlVvN9ZGp5sp86OjA8IZQreTaiRHtJkmTPWyh8SP2UPgpRFGh05'], 'user': ['1'], '36': ['on']}&gt;
  </code></pre>
  <p>The selected radio button's are translated to 'on' rather than their actual value.
  I intend to see the question id and the level detail just like user something like:
  'question': '36'
  'level': 'Expert'</p>
  <p>Any hints on what I may be doing wrong.. P.S I'm pretty new to django</p>