jQuery验证自定义消息 [英] jQuery Validate custom messages

查看:130
本文介绍了jQuery验证自定义消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我有一个输入,我想在用户没有填写时显示自定义错误消息。 >< input type =textclass =foovalue =data-prop =foodata-rules ={required:true}>< / input> 

如何将自定义错误消息添加到此特定输入?

  data-msg-required =

解决方案

请在这里输入一些东西!

下面是一个演示HTML代码: https://github.com/jzaefferer/jquery-validation/blob/master/demo/custom-messages-data-demo.html



JS小提琴演示: http:// jsfiddle。 net / leniel / VuPPy / 48 /

I have an input that I want to display a custom error message on when the user doesn't fill it out.

    <input type="text" class="foo" value="" data-prop="foo" data-rules="{ required: true }"></input>

How do I add a custom error message to this specific input?

解决方案

Use:

data-msg-required="Please enter something here!"

Here's a demo HTML code: https://github.com/jzaefferer/jquery-validation/blob/master/demo/custom-messages-data-demo.html

JS Fiddle demo: http://jsfiddle.net/leniel/VuPPy/48/

这篇关于jQuery验证自定义消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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