问题描述
嗨朋友们,
我有正则表达式的文本字段。
我想在模糊时验证字段,而不是在keyup事件上验证。
我试过以下:
Hi friends,
I have text field with regular expression.
I want to validate the field on blur, not on keyup event.
I tried following:
$('#txtMinRange[data-val-regex-pattern]').keyup(function () { return false });
但它确实是第一次工作,但是当用户尝试编辑值时,验证运行以获得密钥
任何想法,如何去做?
提前致谢
But it does work for first time, but when the user tries to edit value the validation runs for keyup
Any idea, how to go about it?
Thanks in advance
推荐答案
但它确实有效第一次,但是当用户尝试编辑值时,验证运行为keyup
任何想法,如何去做?
先谢谢
But it does work for first time, but when the user tries to edit value the validation runs for keyup
Any idea, how to go about it?
Thanks in advance
总之,我想要验证Blur上的控件不在KeyUp
有没有办法呢?
In short, I want to validate the control on Blur not on KeyUp
Any way to do it?
当然。
Of course.
someElement.onblure = function() { /* some validation here */ }
使用jQuery,这更简单: []。
有问题吗?
这篇关于jQuery验证 - 禁用Unobtrusive OnKeyUp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!