title: Jquery input phone number validation
body: <p>i had a normal input box, but i want to made a validation on keypress.</p>
  
  <p>so the input must starting with 08 or +62 and length must be minimum of 8 and max is 14</p>
  
  <p>here's my code on jquery. </p>
  
  <pre><code>$(".PhoneVal").keyup(function (e) {
  var $this = $(this);
  var val = $this.val();
  var size = $this.val().length;
  // console.log(size);
  if (size != 2) {
      // e.preventDefault();
      $this.val(val);
  }
  else if (size = 2 &amp;&amp; val != 08) {
      e.preventDefault();
      $this.val('');
      $.notify({
          // options
          message: 'Invalid Number, use starting with 08 or +628' 
        },{
          // settings
          type: 'warning',
          allow_dismiss: true,
          delay: 2000,
          z_index: 2000
        });
  
  }
  
  if (size &gt; 14) {
      e.preventDefault();
      $this.val();
      $.notify({
          // options
          message: 'Invalid length of number' 
        },{
          // settings
          type: 'warning',
          allow_dismiss: true,
          delay: 2000,
          z_index: 2000
        });
    }
  </code></pre>
  
  <p>also i want to made if its typed more than 14, then it should show notify and cant be typed anymore or the length stop at 14.</p>
  
  <p>in this code, i only can validate if the number should start with 08, i dont know how to made with +62 </p>