Parsley custom error message doesn't work

橙三吉。 提交于 2019-12-21 07:34:59

问题


I have the following input field:

<input id="name" name="real_name" type="text" placeholder="ie. Your full name or company name" class="form-control input-lg parsley-validated"
   data-required="true" parsley-error-message="Please insert your name" >

However, when I press my submit button, I only get the standard This value is required. message.

Can anyone tell me why?


回答1:


Try this attribute instead of 'parsley-error-message':

data-required-message="Please insert your name"

It's not a custom error message for custom validator. You need to override the default 'required' error message with your one.




回答2:


Try

data-parsley-required-message="Please insert your name"



来源:https://stackoverflow.com/questions/21392813/parsley-custom-error-message-doesnt-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!