wFORMS.functionName_formValidation = "doPostBack";
function doPostBack(e) { 
  if(!e) e = window.event;    
  
  //  call the default error management.  
  if(wFORMS.behaviors['validation'].run(e)) {            
    //  doing our custom validation here:

    // if needed, the form element can be obtained with:
    // var f = wFORMS.helpers.getSourceElement(e);

    var passwordField = document.getElementById('code');
    var confirmField  = document.getElementById('code2');
            
    if(passwordField.value != confirmField.value) {
      //passwords don't match, show error message:
      var errorMessage = "The codes don't match.";
      wFORMS.behaviors['validation'].showError(confirmField, errorMessage);
      // we need to prevent the submission:
      return wFORMS.helpers.preventEvent(e);   
    }
    // otherwise all is good, 
    return true; 
	}                       
}