title: Script to disable a text box on selecting a radio button
body: <p>I have two radio buttons</p>
  
  <pre><code> &lt;div class="col-md-2"&gt;
  
                  @Html.RadioButtonFor(model =&gt; model.ReceiveCopyOrders, "true") Yes
  
              &lt;/div&gt;
              &lt;div class="col-md-3"&gt;
  
                  @Html.RadioButtonFor(model =&gt; model.ReceiveCopyOrders, "false", new { @id = "mailForOrder_no" }) No
              &lt;/div&gt;
  </code></pre>
  
  <p>and a text box</p>
  
  <pre><code>      &lt;div class="col-md-10"&gt;
                  @Html.TextBoxFor(m =&gt; m.OrderEmail, new { @class = "form-control",@id="
  
  mailForOrder" })
          &lt;/div&gt;
  </code></pre>
  
  <p>If the radio NO is checked I want the textbox to be disabled.</p>
  
  <p>I tried the script below</p>
  
  <pre><code>&lt;script&gt;
  
      $(document.getElementById('mailForOrder_no')).checked(function () {
  
          document.getElementById('mailForOrder').disabled = true;
  
          });
  </code></pre>
  
  <p></p>
  
  <p>But the checkbox is not disabled.</p>
  
  <p>What am I doing wrong ?</p>