how can I not processing the form If not all required fields have been filled in?

how can I not processing the form If not all required fields have been filled in?

Hello,

I have a form and I validate the form. This is required: at least one letter, at least one capital letter, at least one number, be at least 8 characters.
I want to have if all is required is done then processing the form.
But now if you type one letter and you click on the button then is the form processing.

my question is: how can I not processing the form If not all required fields have been filled in?

thanks in advance.

the code is:
  1. $(document).ready(function(e) {
  2.     $('input[type=password]').keyup(function(e) {
  3.    
  4.    // if(pswd == false)
  5.     //{
  6.     //    stopEvent(e);
  7.    // }
  8.    
  9.      var pswd = $(this).val();
  10.     
  11.      //validate the length
  12. if ( pswd.length < 8 ) {
  13.     $('#length').removeClass('valid').addClass('invalid');
  14.     //return false;
  15.    
  16. } else {
  17.     $('#length').removeClass('invalid').addClass('valid');
  18.    // return true;
  19. }
  20. //validate letter
  21. if ( pswd.match(/[A-z]/) ) {
  22.     $('#letter').removeClass('invalid').addClass('valid');
  23. } else {
  24.     $('#letter').removeClass('valid').addClass('invalid');
  25.    
  26. }
  27. //validate capital letter
  28. if ( pswd.match(/[A-Z]/) ) {
  29.     $('#capital').removeClass('invalid').addClass('valid');
  30. } else {
  31.     $('#capital').removeClass('valid').addClass('invalid');
  32.    
  33. }
  34. //validate number
  35. if ( pswd.match(/\d/) ) {
  36.     $('#number').removeClass('invalid').addClass('valid');
  37. } else {
  38.     $('#number').removeClass('valid').addClass('invalid');
  39.   
  40. }
  41.     
  42.     // keyup code here
  43. }).focus(function() {
  44.     $('#pswd_info').show();
  45. }).blur(function() {
  46.     $('#pswd_info').hide();
  47. });
  48. //function stopEvent(e) {
  49.     if (e.stopPropagation) e.stopPropagation();
  50.     else e.cancelBubble = true;
  51.     if (e.preventDefault) e.preventDefault();
  52.     else e.returnValue = false;
  53. //}
  54. });