ansman/validate.js

Don't automatically prepend name on error messages

Closed this issue · 2 comments

I need to remove the automatically prepended name to the error messages. Is this possible? The names on my inputs need to be a certain format which is not user friendly. Thanks.

You can do either of the following:

  1. Prefix your message with a caret:
    message: "^This error message will not prepend the attribute name."

  2. Set the fullMessages option to false:

    var options = {
        fullMessages: false
    }
    
    validate(attributes, constraints, options);
    

Thanks very much for your help!!