title: JQuery allow only two numbers after decimal point
body: <p>I found the following JQuery function <a href="https://stackoverflow.com/questions/6421639/jquery-only-allow-input-float-number">here</a> which prevents a user from entering anything that's not a number or a single decimal.  The function works well but I'd like to improve it to prevent the user from entering 3 or more decimal places i.e. disallow 99.999 and allow 99.99. Any ideas?</p>
  
  <pre><code> function checkForInvalidCharacters(event, inputBox){                            
       if ((event.which != 46 || inputBox.val().indexOf('.') != -1) &amp;&amp; (event.which &lt; 48 || event.which &gt; 57)) {          
                  event.preventDefault();           
              }   
       };
  </code></pre>