如何从表单中删除jQuery验证? [英] How do I remove jQuery validation from a form?

查看:212
本文介绍了如何从表单中删除jQuery验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery验证插件来验证表单,如果点击某个链接,我想删除验证并提交表单。

I'm using the jQuery validation plugin to validate a form, and I'd like to remove the validation and submit the form if a certain link is clicked.

我正在使用javascript提交表单,例如 jQuery('form#listing')。submit(),所以我必须使用javascript删除验证规则/函数。

I am submitting form with javascript like jQuery('form#listing').submit(), so I must remove the validation rules/function with javascript.

问题在于我无法弄清楚如何做到这一点。我尝试过像 jQuery('form#listing')。validate({}); jQuery('form#listing')这样的东西。 validate = null ,但没有运气。

The problem is that I can't figure out how to do this. I've tried things like jQuery('form#listing').validate({}); and jQuery('form#listing').validate = null, but with no luck.

推荐答案

触发DOM提交方法以跳过验证:

Trigger the DOM submit method to skip the validation:

$("#listing")[0].submit();

这篇关于如何从表单中删除jQuery验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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