title: jquery min and maxlength validation
body: <p>I want <code>minlength=8</code> and <code>maxlength=14</code>, how can I achieve this validation.</p>
  
  <p>html:</p>
  
  <pre><code>&lt;input type="text" name="354" id="field"&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>$("input[name=354]").keypress(function(e){
  if (e.which != 8 &amp;&amp; e.which != 0 &amp;&amp; (e.which &lt; 48 || e.which &gt; 57)) {
  $("#errmsg").html("Digits only").show().fadeOut("slow");
  return false;
  }
  });
  </code></pre>