title: Allow to enter only 2 decimal points number
body: <p>I have a condition to allow user to input only 2 decimal points number and restrict the alphabets and other characters. I used the following function: </p>
  
  <pre><code>function isNumberKeyOnlyWithDecimalFormat(event,value,id){
          var val = value;
           if (event.shiftKey === true) {
                  event.preventDefault();
          }
          if ((event.keyCode &gt;= 48 &amp;&amp; event.keyCode &lt;= 57) ||
             (event.keyCode &gt;= 96 &amp;&amp; event.keyCode &lt;= 105) ||
              event.keyCode == 8 || 
              event.keyCode == 9 ||  
              event.keyCode == 37 || 
              event.keyCode == 39 || 
              event.keyCode == 46 || 
              event.keyCode == 190) {
  
          } else {
              event.preventDefault();
          }
          if(val.indexOf('.') !== -1 &amp;&amp; event.keyCode == 190){
              event.preventDefault();
          }
          if ((pointPos =   $('#'+id).val().indexOf('.')) &gt;= 0){
              $('#'+id).attr("maxLength", pointPos+3);
          }
          else
              $('#'+id).removeAttr("maxLength");  
          }
  </code></pre>
  
  <p>It is working fine while first time adding. But it restricts the if i want to edit the digits if it has already 2 decimal place. Can anyone help with this?</p>