Anders Nilsson
Anders Nilsson

Reputation: 1485

Parsely.js override default validation messages

Does anyone here know how you can override validation messages during setup.

I would like to be able to during setup $('form').parsley() to change/define validation messages messages for lets say:

data-parsley-required-message ="some relevant custom message"

I want this to be assigned to all validations so if the field is set to required it will display the custom message as default.

Thanks in advance 8-)

Upvotes: 2

Views: 2550

Answers (1)

Turophile
Turophile

Reputation: 3405

Look in the documentation for window.ParsleyUI.updateError(parsleyInstance, name, message);.

This is assuming version 2, if you are still on 1.X let me know and I will amend the answer.

Upvotes: 2

Related Questions