简体   繁体   English

jQuery 验证插件未验证 iframe 中的表单

[英]jQuery validation plugin not validating form in iframe

I am using this plugin:我正在使用这个插件:

http://bassistance.de/jquery-plugins/jquery-plugin-validation/ http://bassistance.de/jquery-plugins/jquery-plugin-validation/

To validate a form that is hosted on a different server from my development site.验证托管在与我的开发站点不同的服务器上的表单。 All the validation scripts are on that document and appear to be working fine.所有验证脚本都在该文档上,并且似乎工作正常。

http://forms.icis.com/content/CHX0041_RequestFreeTrial http://forms.icis.com/content/CHX0041_RequestFreeTrial

I am using an iframe to pull in the form from the external site but when i try and submit the form and fire the validation script it is not working.我正在使用 iframe 从外部站点拉入表单,但是当我尝试提交表单并触发验证脚本时,它不起作用。 It just submits the form as if there was no validation at all.它只是提交表单,就好像根本没有验证一样。

The iframe sits within a CMS page that is contained in another form so i thought the issue may be there. iframe 位于以另一种形式包含的 CMS 页面内,因此我认为问题可能存在。 This fiddle demonstrates the issue:这个小提琴演示了这个问题:

http://jsfiddle.net/We78c/ http://jsfiddle.net/We78c/

EDIT编辑

It seems as though removing the URL paramaters from the iframe src fixes the issue:似乎从 iframe src 中删除 URL 参数可以解决问题:

http://jsfiddle.net/We78c/2/ http://jsfiddle.net/We78c/2/

However i need them so as to pass them through to some hidden input variables in the child iframe.但是我需要它们以便将它们传递给子 iframe 中的一些隐藏输入变量。 Is this a known issue?这是一个已知的问题?

In your form you're setting the method="#" and action="post".在您的表单中,您设置了 method="#" 和 action="post"。 The method should be method="post" and action should be the url where you're posting.方法应该是 method="post" 并且 action 应该是您发布的 url。

There was a JS error causing this to fail the validation.有一个 JS 错误导致验证失败。 Commented out and seems to be working now.已注释掉,现在似乎正在工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM