title: enable textbox based on checkbox selection on load
body: <p>I have 2 checkbox, where it control enable or disable of the textbox txtProductName. Currently if the checkbox 2 is checked on load the txtProductName is disable however if the checkbox 1 selected on load the txtProductName is still disable where it supposed to enable</p>
  
  <pre><code>&lt;input type="checkbox" id="Check1" value="Value1" onclick="selectOnlyThis(this.id)" style="margin:1em 1em 5px 5px" @(ViewBag.Status == "Yes" ? " checked" : "")/&gt;Yes
  
  &lt;input type="checkbox" id="Check2" value="Value1" onclick="selectOnlyThis(this.id)" style="margin:1em 1em 5px 5px" @(ViewBag.Status == "No" ? " checked" : "")/&gt;No
  
  
  @Html.TextBoxFor(m =&gt; m.ProductName, new { id = "txtProductName", style = "width: 150px;margin:1.0em 1.5em 5px -10px;height:20px; font-size:12px", @Value = ViewBag.ProductName })
  
  
  
  if ($('#Check1 :checked')) {
              $('#txtProductName').removeAttr("disabled");
  }
  if ($('#Check2 :checked')) {
              $('#txtProductName').attr('disabled', 'disabled').css("backgroundColor", "white");
  }
  </code></pre>