问题
I am having trouble to change this error message. I need the message to be displayed in french.
<input type="text" name="name" id="name" size="30"
class="text-input-big" placeholder="PRÉNOM"
parsley-type="alphanum"
parsley-error-message="Le prénom est requis" required />
I used this for my first field, but no matter what I do, or add, still can't see the message that I want to see.
回答1:
Since you are using "alphanum" as type, you could use:
<input type="text" name="name" id="name" size="30"
class="text-input-big" placeholder="PRÉNOM"
parsley-type="alphanum"
parsley-alphanum-message="Le prénom est requis" required />
If you specify the message directly in input, you have to do that for every field (and everytime).
So, the best option is using Localization (see http://parsleyjs.org/doc/index.html#psly-installation-localization). You can download the french localization from here: https://github.com/guillaumepotier/Parsley.js/tree/master/src/i18n. Then you can define your messages in the localization file.
来源:https://stackoverflow.com/questions/20476315/how-do-i-change-the-error-message-please-fill-out-this-field