title: Javascript function to allow only numbers dot and comma. I want to pass this input value by POST ajax call
body: <p>The below code allows only number and dot.
  How to improvise to allow the comma as well.</p>
  <pre><code>function isNumberandComma(evt) {
      var iKeyCode = (evt.which) ? evt.which : evt.keyCode;
      if (iKeyCode != 46 &amp;&amp; iKeyCode &gt; 31 &amp;&amp; (iKeyCode &lt; 48 || iKeyCode &gt; 57)){
          return false;
      }
      return true; 
  } 
  </code></pre>