MVC 3 - 如果检查的形式是有效的(已通过客户端验证) [英] MVC 3 - checking if form is valid (has passed client side validation)

查看:113
本文介绍了MVC 3 - 如果检查的形式是有效的(已通过客户端验证)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了在MVC 3盒客户端验证在客户端,我想如果表单已通过客户端验证检测。如果是的话我想显示的占用指示灯和禁用提交按钮。

I am using out of the box client side validation in MVC 3. At the client side, I want to detect if the form has passed client side validation. If so I want to display an busy indicator and disable the 'submit' button.

所以我找了错误的集合,我可以从JS查询的form.isValid type属性。

So I am looking for a form.isValid type property of a collection of error that I can query from js.

任何指针。

感谢

PJ

推荐答案

您可以使用下列内容:

if ($('#yourform').valid()) {
    // the form passed client side validation
    // TODO: show busy indicator and disable submit button
}

这篇关于MVC 3 - 如果检查的形式是有效的(已通过客户端验证)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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