Use consistent names for errors: Maybe fieldname_problem? "notvalid" is a bad name. "not_matched" is a bad name. Better names:

username_invalid
password_small
password_mismatch
password_wrong
email_invalid
email_used

etc.