为什么jquery表单插件与fckeditor & 冲突文件上传?
我创建了一个包含 FCKEditor + 文件输入框的表单,并且使用下面 jquery 表单插件提供的 ajaxSubmit() 方法提交表单。
如果我不使用文件输入框, FCKEditor 值正确提交,但如果我在表单中添加文件输入框,FCKEditor 的更新内容不会被存储。它仅存储旧值。有什么建议吗?谢谢。
I have created a form which contains the FCKEditor + File input box, and I am submitting the form using ajaxSubmit() method provided by jquery form plugin below.
If I don't use File input box, the FCKEditor values submit properly but if I add File input box in the form, the updated content of FCKEditor do not get stored. It stores old values only. Any suggestions ? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,这似乎是因为将处理程序附加到文件上传表单的 javascript 函数与页面 $('form') 中的所有表单匹配,其中包括封装 CKEditor 的表单。
您可以通过在上传表单中添加一个 id 字段并在附加事件处理程序时定位该特定 id 来解决此问题,这样 CKEditor 就不会受到影响。
例如
I had the same problem, it appears to be because the javascript function that attaches the handler to the file upload form is matching all forms in the page $('form') which includes the form that encapsulates the CKEditor.
You can solve this by adding an id field to your upload form and targeting that specific id when you attach the event handler so CKEditor is not affected.
e.g.