The following script works fine:
$("#regform").validate().showErrors({"username":"message"});
After I changed the script to the below one, it doesn't work.
var name = "username";
$("#regform").validate().showErrors({name:"message"});
I need to pass the field name by a variable. Anyone knows how this problem can be solved?