title: Is there a way to create an option on an HTML form to allow a user to select exactly 2 of n choices?
body: <p>I am trying to build an HTML form. For one of the questions, I want the user to be able to select exactly two choices.</p>
  
  <p>I tried building two radio questions (which I understand only accept one choice) with the same 4 options, but I don't want the user to be able to select the same option twice.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form action = "\new" method = post target="_blank" id="form"&gt;
  &lt;option&gt;Option 1&lt;/option&gt;&lt;br&gt;
  Question 1:
  &lt;input type="radio" name="S1" value = 0 checked&gt;C1&lt;br&gt;
  &lt;input type="radio" name="S1" value = 1&gt;C2&lt;br&gt;
  &lt;input type="radio" name="S1" value = 2&gt;C3&lt;br&gt;
  &lt;input type="radio" name="S1" value = 3&gt;C4&lt;br&gt;
  &lt;br&gt;
  Question 2:
  &lt;input type="radio" name="S2" value = 0 checked&gt;C1&lt;br&gt;
  &lt;input type="radio" name="S2" value = 1&gt;C2&lt;br&gt;
  &lt;input type="radio" name="S2" value = 2&gt;C3&lt;br&gt;
  &lt;input type="radio" name="S2" value = 3&gt;C4&lt;br&gt;
  &lt;/form&gt;
  //I want the form to output (S1,S2), but S1 cannot equal S2
  </code></pre>
  
  <p>With this code, the user can still choose the same choice for both questions. How do I fix this?</p>