如何在进程上的TextChange时停止验证消息 [英] How to Stop Validation Message when TextChange on Process

查看:98
本文介绍了如何在进程上的TextChange时停止验证消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个模型属性(FirstName),其中我正在申请一个属性

StringLength(2, 30,ErrorMessage =请提供有效的名字。)



这个工作正常。但我的要求是当我只放置单个字符时,错误就是触发。所以我需要验证onblur上的控件没有变化。所以任何人都可以建议我如何做到这一点。



我希望在某些属性上实现这些功能。







谢谢

Hi Everybody,

I have a model Property (FirstName) in which have i am applying an attribute
StringLength(2,30,ErrorMessage="Please provide a valid name.")

this is working fine. but my requirement is when i am placing only single char then the error is firing. so i need to validate the control on onblur not in change. so can anyone suggest me how to do that.

and i want these implementation on some properties not in all.



thanks

推荐答案

您可以通过删除这些属性的数据注释轻松实现这一目标然后使用jQuery或 jQuery Validation Plugin 。然后你将完全控制你的验证。



这是jQuery Validation插件:



http://jqueryvalidation.org/documentation/ [ ^ ]





我希望这会对你有所帮助。
You can easily achieve that by removing data annotation for those properties and use jQuery or jQuery Validation Plugin.Then you will have full control for your validations.

Here is the jQuery Validation Plugin :

http://jqueryvalidation.org/documentation/[^]


I hope this will help to you.


这篇关于如何在进程上的TextChange时停止验证消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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