title: How to pass Textbox value to Javascript function?
body: <p>My View code is as below where I am calling a javascript function on key up event. I want to pass the control value to javascript function.
  I tried using 'this' and @this, but it didn't work.</p>
  
  <pre><code>@Html.TextBoxFor(m =&gt; m.LeaveDetailsList[0].LeaveTaken, new {id = "numLeaveTaken1", width = "100", @onkeyup = "checkInp2(this);" })
  </code></pre>
  
  <p>** Edited **
  Javascript code:</p>
  
  <pre><code>function checkInp2(ControlId) {
      var x = document.getElementById(ControlID).value;
      if (isNaN(x)) {
          document.getElementById("btnSave").disabled = true;
          return false;
      }
      else {
          document.getElementById("btnSave").disabled = false;
      }
  }
  </code></pre>