本文介绍了欧芹自定义错误信息不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下输入栏:
< input id =namename =real_nametype =你的全名或公司名称class =form-control input-lg parsley-validated data-required =trueparsley-error-message =请输入你的名字 >然而,当我按下我的提交按钮时,我只得到标准
有人告诉我为什么?解决方案试试这个属性而不是'parsley-error-message':
data-required- message =请插入您的姓名这不是自定义验证器的自定义错误消息。 您需要覆盖默认的'required'错误消息。
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?
解决方案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.
更多推荐
欧芹自定义错误信息不起作用
发布评论