欧芹自定义错误信息不起作用 [英] Parsley custom error message doesn't work

查看:105
本文介绍了欧芹自定义错误信息不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下输入栏:

 < 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.

这篇关于欧芹自定义错误信息不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆