title: jquery only allow input float number
body: <p>i'm making some input mask that allows only float number. But current problem is I can't check if multiple dots entered. Can you check those dots and prevent it for me?</p>
  
  <p>Live Code: <a href="http://jsfiddle.net/thisizmonster/VRa6n/">http://jsfiddle.net/thisizmonster/VRa6n/</a></p>
  
  <pre><code>$('.number').keypress(function(event) {
      if (event.which != 46 &amp;&amp; (event.which &lt; 47 || event.which &gt; 59))
      {
          event.preventDefault();
          if ((event.which == 46) &amp;&amp; ($(this).indexOf('.') != -1)) {
              event.preventDefault();
          }
      }
  });
  </code></pre>