title: Enabling/disabling radio buttons according to the state of a checkbox
body: <p>I have a form with several checkboxes and, below each of those checkboxes, a set of radio buttons. I want to disable and reset radio buttons when the corresponding checkbox is not checked or unchecked.</p>
  
  <p>I tried to enable the radio buttons using the jquery selector <code>:radio[name=vid]</code> but it doesn't work.</p>
  
  <pre><code>&lt;form action='matrix.php' method='post' id='formanal' name='formanal'&gt;
      &lt;ul class="desc"&gt;
          &lt;li&gt;&lt;label&gt;&lt;input type="checkbox" id ="1" value="Couleur des tarses" name="1"&gt;Couleur des tarses&lt;/label&gt;&lt;/li&gt;
          &lt;ul&gt;
              &lt;li class="valeur"&gt;&lt;label&gt;&lt;input type="radio" value="1-1" id="1-1" name="v1" disabled&gt;Jaunes&lt;/label&gt;&lt;/li&gt;
              &lt;li class="valeur"&gt;&lt;label&gt;&lt;input type="radio" value="1-2" id="1-2" name="v1" disabled&gt;Blancs&lt;/label&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/ul&gt;
      ...
      &lt;ul class="desc"&gt;
          &lt;li&gt;&lt;label&gt;&lt;input type="checkbox" id ="8" value="Forme des ailes" name="8"&gt;Forme des ailes&lt;/label&gt;&lt;/li&gt;
          &lt;ul&gt;
              &lt;li class="valeur"&gt;&lt;label&gt;&lt;input type="radio" value="8-15" id="8-15" name="v8" disabled&gt;Pliées en long&lt;/label&gt;&lt;/li&gt;
              &lt;li class="valeur"&gt;&lt;label&gt;&lt;input type="radio" value="8-16" id="8-16" name="v8" disabled&gt;Étalées en toit&lt;/label&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/ul&gt;
      &lt;input type='submit' name='action' value='Valider'&gt;&lt;/div&gt;
  &lt;/form&gt;
  
  $(document).ready(function() {
      $("form input:checkbox").change(function() {
          var vid = 'v' + this.id;
          var etat = $(this).prop('checked');
          if (etat) {
              $(':radio[name=vid]').prop('disabled', false);
          } else {
              $(':radio[name=vid]').prop('checked', false);
              $(':radio[name=vid]').prop('disabled', true);
          }
      });
  });
  </code></pre>
  
  <p>The radio buttons are disabled when created, but a click on the corresponding checkbox doesn't enable them.
  Thanks in advance for any clue.</p>