title: Jquery validation not working if validation fails
body: <p>I have a real-time jquery validation for name. It is working on real time but when i submit my form it submit the value even after displaying error message.
  This is my code for validation:</p>
  
  <pre><code>  $(document).ready(function(){
    var $regexname=/^([a-zA-Z]{3,16})$/;
    $('.firstname ').on('keypress keydown keyup',function(){
           if (!$(this).val().match($regexname)) {
               $('.fname').removeClass('hidden');
               $('.fname').show();
           }
         else{
              $('.fname').addClass('hidden');
             }
       });
      });
  </code></pre>
  
  <p>Anyone please help me that when error message displays form doesnot get submit.</p>