문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top