title: IP address validation with proper dots in between
body: <p>I wanted to validate only for IP address accepting only 3 three dots after some numbers</p>
  
  <p>ex: 
  Valid: 191.123.121.202        is valid which has 3 dots after some decimal.
  Invalid : 191..123.121.202    is invalid where 2 dots are in sequence</p>
  
  <p>Whole Point: wanted a robust IP validator  </p>
  
  <pre><code>$("input.onlynumberdecimal").keydown(function (event) {
  
          console.log(event.keyCode);
  
          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($(this).val().indexOf('.') !== -1 &amp;&amp; event.keyCode == 190)
              event.preventDefault(); 
          //if a decimal has been added, disable the "."-button
  
      });
  </code></pre>
  
  <p>TO some extent i have got with the help of some other site. And also wanted if the user copy and paste the correct IP, then it should accept, else it should not allow him to paste.</p>
  
  <p><a href="http://jsfiddle.net/2GhVn/" rel="nofollow">DEMO</a></p>