title: How to make format validation function for input text with Jquery
body: <p>I have form like this</p>
  
  <pre><code>&lt;p&gt;Masukan Posisi Baru&lt;/p&gt;
  &lt;input type="text" id="nposisi"/&gt;&lt;/br&gt;
  &lt;button id="ok"&gt;OK&lt;/button&gt;
  </code></pre>
  
  <p>on "OK" click function i must validate that text input not empty and accordance with my format.</p>
  
  <p>my format input text:</p>
  
  <ol>
  <li>combine font and  numeral</li>
  <li>have 3-5 font</li>
  <li>must capital font</li>
  <li>coma and another punctuation mark not allowed except dot</li>
  </ol>
  
  <p>ex: A2.8</p>
  
  <p>for empty validation just simple</p>
  
  <pre><code>$(document).ready(function(){
      $("#ok").click(function(){
         var nposisi = $("#nposisi").val();
         if(nposisi==""){
            alert("Masukan dulu posisi baru");
            exit();
         }
      });
  });
  </code></pre>
  
  <p>but my problem i have no idea in format validation? any idea for this. Thank's before</p>