title: Limit string to 2 numbers after comma and only ONE comma
body: <p>I have this script below to allow only numbers and comma on a input text.</p>
  
  <pre><code>function validate(evt) {
    var theEvent = evt || window.event;
    var key = theEvent.keyCode || theEvent.which;
    key = String.fromCharCode( key );
    var regex = /[0-9,]|\./;
    if( !regex.test(key) ) {
      theEvent.returnValue = false;
      if(theEvent.preventDefault) theEvent.preventDefault();
    }
  }
  
  &lt;input type="text" name="price" onkeypress='validate(event)'&gt;
  </code></pre>
  
  <p>How can I modify this code to allow only <strong>one comma</strong> and after the comma allow only <strong>two</strong> numbers? I wouldn't like to use jQuery to solve this issue.</p>
  
  <pre><code>EXAMPLE:
  1234,56 (stop)
  1,23 (stop)
  123,45 (stop)
  1234567,89 (stop)
  </code></pre>