title: Javascript for a textbox to accept 4 numbers and two decimals
body: <p>I have a textbox in my aspx page which should accept only values like 9999.00 where two decimal positions are mandatory. need a javascript for the above functionality please help</p>
  
  <pre><code> function isNumber(evt) {
          try {
              evt = (evt) ? evt : window.event;
              var charCode = (evt.which) ? evt.which : evt.keyCode;
  
              if (charCode &gt; 47 &amp;&amp; charCode &lt; 58) {
                  return true;
              }
              else if (charCode == 46) {
                  return true;
              }
              else {
                  alert('please enter a number');
                  return false;
              }
          }
          catch (err) {
              alert(err);
          }
      }
  </code></pre>
  
  <p>This is the code that i have written to validate only numbers are enterred now in the same way only 4 numbers and after that two decimals should be enterred</p>