当页面上包含jQuery Validator时,jQuery File Upload插件不起作用 [英] jQuery File Upload Plugin don't work when jQuery Validator included on page

查看:145
本文介绍了当页面上包含jQuery Validator时,jQuery File Upload插件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

同时放置两个 jQuery文件上传插件(多文件上传)时遇到问题和jQuery Validation Plugin脚本在同一页面上(一种形式).

Have problem with putting both jQuery File Upload Plugin (multi file upload) and jQuery Validation Plugin script on same page (one form).

如果我关闭jQuery Validation,一切正常,我可以获取上载的图像文件,并将其放在自动生成的输入字段中,然后在表单提交中获取其值.如果我包含jQuery Validation插件,则上传不起作用,并且无法在生成的输入中获取图像文件名值.

If I turn off jQuery Validation everything works fine, I can get uploaded image files and put them in auto generated input fields and then on form submit get their values. If I include jQuery Validation Plugin, upload doesn't work and I can't get image file name values on generated inputs.

工作表位于此处(无jQuery验证).

Working form is here (without jQuery Validation).

有人知道问题出在哪里吗?我该如何解决?还是我只是从网站上的特定表单中删除jQuery Validation(这不是最好的解决方案,但是会起作用)吗?

Anyone knows where the problem is ? How can i solve it ? Or do I just remove jQuery Validation from that specific form on website (it's not best solution but it will work) ?

推荐答案

弄清楚了,<div id="mulitplefileuploader">Upload</div>必须在验证表单之外,并且一切正常.图片已正确上传到服务器上,带有文件名值的输入字段在验证表单中生成,并在ajax发布请求中传递.

Figured it out, <div id="mulitplefileuploader">Upload</div> must be outside validation form and everything works fine. Images are uploaded correctly on the server and input fields with file name values are generated inside validation form and passed in ajax post request.

这篇关于当页面上包含jQuery Validator时,jQuery File Upload插件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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