欧芹自定义错误信息不起作用

编程入门 行业动态 更新时间:2024-10-10 01:22:19
本文介绍了欧芹自定义错误信息不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有以下输入栏:

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

更多推荐

欧芹自定义错误信息不起作用

本文发布于:2023-11-02 06:05:18,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   错误信息   不起作用

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!