Reputation: 6131
As a developer integrating parsley.js
I would like to add a value to the standard required validator
so that the message is showing a message like
"The field email is required"
where the value in the above example is "email"
<input type="text" value="" name="email" data-parsley-required="email">
in i18n/en.js
window.ParsleyConfig.i18n.de = $.extend(window.ParsleyConfig.i18n.de || {}, {
[...]
required: "The field % is required",
[...]
});
Thanks for your help
Upvotes: 2
Views: 1637
Reputation: 7448
You simply cannot do that. data-parsley-required
option have a specific API and must handle booleans.
If this is the error message that bothers you, please use data-parsley-error-message
or data-parsley-required-error-message
. You could find more info about these options here: http://parsleyjs.org/doc/index.html#psly-ui-for-field
Best
Upvotes: 2