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

查看:28
本文介绍了如何从表单中删除 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.

我正在使用像 jQuery('form#listing').submit() 这样的 javascript 提交表单,所以我必须使用 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天全站免登陆