Q: jQuery, form validation, message after validation of .each field EDIT FINAL: OMG, i finally found out what goes wrong!! i allmost can't believe, i am testing this piece for 8 hours non stop, and finally...... i am still not sure what and how and why, but it appears that for some reason (i think) i cant have different values for the re-variable, because there are different fields, 1 time, its for a text and the other time for a number, for example, if i just define different variables for each possible regex in stead of redefining it, there is no problem! o.O
i have posted the code that i use now in a reply under this post
thanks so much for anyone that have spend some time reading and thinking about this!!
if anyone has ideas on why it went wrong, i am very interested!

original question:
cant find the logic why this wont work.. i have a form that i want to validate, each field should be validated onBlur: works perfect, on submit it should validate each field: works perfect, when there is some kind of error, it should show a message and return false: does not work.. for some reason, the submit function just does not want to do anything after the .each, it wont even work when i dont do any check on errors, and just want an alert after the .each..
EDIT: after the mentions of some little errors, it unfortunately still wont work.. here is the total code, inclusive the checkfield-function (the error messages are in dutch, in case you're wondering ;))
EDIT2: after more testing, it seems its not because of the checkform function, but something to do with the regex test ( if (!re.test(fieldvalue)) ) that gets the code stuck.. cant find the problem though.. any thoughts would be much appreciated! 
EDIT3: why wont the checkfieldfunction with the regex not loop with .each?? anyone?? i am really desperate.. -.- 
function trim(str){
  return str.replace(/^\s+|\s+$/g, '');
}

function checkfield(field){  

  var output = 'validate' + $(field).attr("name");
  var type = $(field).attr("type");
  if ($(field).hasClass('required')){var required = 1;}

  //set patterns for different types
  if (type == 'text') { var re = /^[A-Za-z0-9 -._]+$/;} 
  if (type == 'number') { var re = /^[\d -.]+$/;} 
  if (type == 'email') { var re = /^[\w-_.]+@[\w]+\.[\w]*\w\w$/;} 
  if (type == 'date') { var re = /^[0-3][0-9][\/-][0-1][0-9][\/-](19|20)[0-9][0-9]$/;} 

  var fieldvalue = trim(field.value); //trim value of input

  if (required == 1 && emptyString.test(fieldvalue)) { //is required field filled in? if no, return false
     $('#'+output).html('Invullen van onderstaand veld is verplicht!');

     field.focus();
     return false;  
    }

  else if (fieldvalue != "" && type != '' && !re.test(fieldvalue)) { //input according to pattern? if no: place message, return false

     if (type == 'email') {$('#'+output).html('Dit is geen correct e-mailadres!');}
     else if (type == 'date') {$('#'+output).html('Dit is geen correcte datum!');}
     else {$('#'+output).html('U gebruikt tekens die niet zijn toegestaan!');}

     field.focus(); 
     return false;
    }

  else if (fieldvalue != ""){ //when no error and filled in, empty messagebox, return true 
     $('#'+output).html('');

     return true; 
    }

  else if (required == 0 && fieldvalue == ""){//is empty but not required, empty messagebox, return true
     $('#'+output).html('');
     document.getElementById(output).innerHTML = '';
     return true;   
    }
}


$(document).ready(function(){

  $("#userform input").blur(function(){
  checkfield(this);
  })

  $("#userform").submit(function(){
    var errs = 0;
    $("#userform input").each(function(){
      if (!checkfield(this)) errs +=1;
    }); 
    if (errs>0) {alert('one or more fields are not correctly filled in'); return false;}

  })
});


new code that works!!
if anyone likes to use a simple form validation, feel free ;) (the spaces are not exactly nice, but thats beacuse my code editor has different rules than this website..)
function trim(str){
  return str.replace(/^\s+|\s+$/g, '');
}

function checkfield(field){  
  var output = 'validate' + $(field).attr("name");
  var type = $(field).attr("type");

  if ($(field).hasClass('required')){var required = 1;}
  var re_text = /^[A-Za-z0-9 -._]+$/;   
  var re_number = /^[\d -.]+$/; 
  var re_email = /^[\w-_.]+@[\w]+\.[\w]*\w\w$/; 
  var re_date = /^[0-3][0-9][\/-][0-1][0-9][\/-](19|20)[0-9][0-9]$/;    
  var emptyString = /^\s*$/ ;

  var error = 0;

  var fieldvalue = trim(field.value); //trim value of input

if (required == 1 && emptyString.test(fieldvalue)) { //is required field filled in? if no, return false
   $('#'+output).html('Invullen van onderstaand veld is verplicht!');
     field.focus();
     return false;  
}

else if (!emptyString.test(fieldvalue)){
 if (type == 'text'){    
   if (!re_text.test(fieldvalue)) {       
     $('#'+output).html('U gebruikt tekens die niet zijn toegestaan!'); 
         error = 1;          
     field.focus();  
       return false;         
   }
     else {$('#'+output).html(''); return true; }    
 }

 if (type == 'number'){  
   if (!re_number.test(fieldvalue)) {     
     $('#'+output).html('U gebruikt tekens die niet zijn toegestaan!');              
     error = 1;
         field.focus();  
       return false;         
   }    
     else {$('#'+output).html(''); return true; }    
 }

 if (type == 'email'){   
   if (!re_email.test(fieldvalue)) {      
     $('#'+output).html('Dit is geen correct e-mailadres!');                 
     error = 1;
         field.focus();  
       return false;         
   }    
     else {$('#'+output).html(''); return true; }    
 }

 if (type == 'date'){    
   if (!re_date.test(fieldvalue)) {       
     $('#'+output).html('Dit is geen correcte datum!');              
     error = 1;
         field.focus();  
       return false;         
   }    
     else {$('#'+output).html(''); return true; }    
 }  
}     

else if (required == 0 && emptyString.test(fieldvalue)){//is empty but not required, empty messagebox, return true
 $('#'+output).html('');
     document.getElementById(output).innerHTML = '';
     return true;   
}

}


$(document).ready(function(){

$("#userform input").blur(function(){
checkfield(this);
})

  $("#userform").submit(function(){
var errs = 0;


$("#userform .form").each(function(){
  if (!checkfield(this)) errs +=1;
        //checkfield(this);
}); 
if (errs>0) {alert('one or more fields are not correctly filled in'); return false;}
//alert(errs); return false;

})
}); 


A: Looks like you need to switch around the + and = in your .each()
if (!checkfield(this)) errs += 1;


A: As Brad Falk pointed out, you should be using errs += 1 rather than errs =+1. However, there are a few other errors as well.
You're missing a semi-colon after the .each() call. This is the only thing I can see that may cause your problem.
In addition to that, your return false isn't part of the if statement block, so it will always prevent form submission even when there are no validation errors - this may be what you want, but since I can't see any evidence of an AJAX post instead, may cause you problems in the future.
