title: How to accept input from one of two textboxes
body: <p>I'm working on a page that accepts input from only one of two textboxes when a checkbox is checked. I tried making a TextChanged event for the first text box that would disable the second textbox but it doesn't work. Here's my code for the textboxes, thanks in advance!</p>
  
  <pre><code>function initSurchargeFields() {
    var $chk = $("#chkSurcharge");
    $chk.click(chkSurcharge_onclick);
  
    var $txt = $("#txtSurcharge");
    var $txta = $("#txtSurcharge1");
  
    if (!$chk[0].checked) {
      $txt[0].disabled = "disabled";
      $txta[0].disabled = "disabled";
    }
  } 
  
  function chkSurcharge_onclick(event) {
    var $txt = $get("txtSurcharge");
    var $txta = $get("txtSurcharge1");
  
    $txt.disabled = this.checked ? "" : "disabled";
    $txta.disabled = this.checked ? "" : "disabled";
  
    if (this.checked) {
      txt.focus();
    }
  </code></pre>
  
  <pre class="lang-csharp prettyprint-override"><code>protected void txtSurcharge_TextChanged(object sender, EventArgs e)
  {
    txtSurcharge1.Enabled = false;
  }
  </code></pre>