title: KnockoutJS - filtering user input
body: <p>I have a simple input text element:</p>
  
  <pre><code>&lt;input type="text" data-bind="value:valInserted,valueUpdate:'afterkeydown'" /&gt;
  </code></pre>
  
  <p>How can I validate the user input on this element? I have a problem with creating the proper binding to port the jQuery code:</p>
  
  <pre><code>$('[id$="pinBox"] :text').keypress(function (e)
  {
     if (!(e.charCode &gt;= 48 &amp;&amp; e.charCode &lt;= 57) &amp;&amp; e.keyCode != 8)
     {
         return false;
     }
  });
  </code></pre>