I am trying to use the showErrors() method as a back up to the client
side validation, My form have server side validation that returns a
json string of invalid fields and a message for each and I was hoping
to use that along with showErrors().

It seems like the only way I can get showErrors() to work is to hard
code the string to pass in.

if I hard code validator.showErrors({"checknumber" : "The check number
is required"}) it works like a charm.

but

var str = {myfieldnamevar : myerrormessagevar};
validator.showErrors(str) ;

 OR

var str = '{"' + myfieldnamevar  + '" : "' + myerrormessagevar + '"}';
validator.showErrors(str) ;

neither work, what am I doing wrong? can I even pass the field and
message in as a variable?

Reply via email to