I figured something out.. in de js file of the validator is the next
section:
formatAndAdd: function( element, rule ) {
var message = this.defaultMessage( element, rule.method
),
theregex = /\$?\{(\d+)\}/g;
if ( typeof message == "function" ) {
//message = message.call(this, rule.parameters,
element); >>
original line
message =
jQuery.format(message.replace(theregex, '{$1}'),
rule.parameters); // replaced line
} else if (theregex.test(message)) {
message =
jQuery.format(message.replace(theregex, '{$1}'),
rule.parameters);
}
this.errorList.push({
message: message,
element: element
});
The first time the field is validated the script goes to the "else
if", the second time you focus/blur the field the first rule of the
"if" kikck in and returns "the filname" or "[object][OBJECT]"...
So I replaced the first "if" with the same statement as the "else if "
and it seems to work fine now. I know this is not a neat solution, and
i also don't know why it works now as it does...
if you know a better solution, please let me know!