title: disable select form if radio is checked
body: <p>How can I disable a select form dropdown if a radio button is selected? </p>
  
  <p>I would like the #preference form to be disabled if the user selects the #no radio button and it to be enabled again if the user selects #yes or #maybe. </p>
  
  <p>This is my form code - </p>
  
  <pre><code>&lt;form name="xmas" id="xmas" action="send_mail.php" method="post"&gt;
              &lt;input type="radio" name="choice" value="Yes" id="yes"/&gt;&lt;label for="yes"&gt;Yes - I would like to take up the offer&lt;/label&gt;
              &lt;input type="radio" name="choice" value="No" id="no"/&gt;&lt;label for="no"&gt;No - I'm not ready to order yet&lt;/label&gt;
              &lt;input type="radio" name="choice" value="Maybe" id="maybe"/&gt;&lt;label for="maybe"&gt;Maybe - I'm not sure, would you please give me a call&lt;/label&gt;&lt;br /&gt;
              &lt;div class="secondlineform"&gt;
                  &lt;input type="text" name="name" class="textfield" value="Name" onfocus="if(this.value=this.defaultValue){this.value=''}; return false;"/&gt;
                  &lt;input type="text" name="email" class="textfield" value="Email" onfocus="if(this.value=this.defaultValue){this.value=''}; return false;"/&gt;
                  &lt;input type="text" name="company" class="textfield" value="Company" onfocus="if(this.value=this.defaultValue){this.value=''}; return false;"/&gt;
                  &lt;select class="dropselect" name="preference" label="Preference" id="preference"&gt;
                      &lt;option selected="selected" disabled="disabled" value="Preference"&gt;Preference&lt;/option&gt;
                      &lt;option value="Alcohol Package"&gt;Alcohol Package&lt;/option&gt;
                      &lt;option value="Gift Card Package"&gt;Gift Card Package&lt;/option&gt;
                  &lt;/select&gt;
                  &lt;input type="submit" value="" name="submit" id="submit" class="submit"/&gt;
  
              &lt;/div&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>And this is my script code - </p>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>​
      <br>
      </p>
  
  <pre><code>  var update_select = function () {
      if ($('#no').is(':checked')) {
      $('#preference').attr('disabled', "disabled");
  }
  else {
      $("#preference").removeAttr("disabled");
  }
  
  };
  
  $(update_select);
  $('#no').change(update_select);
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Thanks very much for any answers! I've been researching this for ages and all the solutions I find don't seem to solve my issue.</p>