如何获得不引人注目的验证我的jQueryUI的元素,(组合框)吗? [英] How to get unobtrusive validation on my JQueryUI element, (Combobox)?

查看:201
本文介绍了如何获得不引人注目的验证我的jQueryUI的元素,(组合框)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ASP NET MVC中,我有一个@ Html.DropDownList中字段的验证是工作就好了。

In ASP NET MVC, I had an @Html.DropDownList in which the validation for the field was working just fine.

正如我所需要的字段设置为可编辑的我决定使用jQueryUI的组合框,但现在我没有变不显眼的审定,直到我提交表单。所以,当我选择一个合适的值,在此之前发布的错误信息不会消失。

As I needed the field to be editable I decided to use the JQueryUI Combobox, but right now I'm not getting the unobtrusive validation until I submit the form. So when I pick a right value, the error message posted before doesn't go away.

我怎样才能让我的jQueryUI的组合框上的每个按键preSS不显眼的审定去工作?

How can I make the unobtrusive validation work again on each Key Press on my JQueryUI Combobox?

推荐答案

字段没有得到验证,因为当你使用jQueryUI的组合框了隐患。蒙山中的document.ready事件下一个脚本指定的验证器不可忽视的隐藏字段。

The fields wasn't getting the validation, because the got hidden when you use the JQueryUi Combobox. Whith the next script in the Document.Ready event you specify the validator to not ignore the hidden fields.

    var validator = $("Form").data('validator');
    validator.settings.ignore = "";

这篇关于如何获得不引人注目的验证我的jQueryUI的元素,(组合框)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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