无法使用 Symfony2 和 TinyMCE 提交表单 [英] Can't submit a form with Symfony2 and TinyMCE

查看:26
本文介绍了无法使用 Symfony2 和 TinyMCE 提交表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含 TinyMCE Javascript 库丰富的文本区域的表单.启用 Javascript 库后,如果我按下提交按钮,页面不会更改!如果我禁用库,一切正常!人们可能会观察到该库没有正确使用(我使用的是 对于傻瓜教程).但是,我认为这与我用来开发网站的框架有关:Symfony2.

I have a form with a textarea enriched by the TinyMCE Javascript library. When the Javascript library is enabled, then if I press the submit button the page don't change! If I disable the library, everything works right! One may observe that the library is not used properly (I'm using the simplest example from the for dummies tutorial). However, I think that it is something related with the framework I'm using to develop the website: Symfony2.

有什么想法吗?

推荐答案

对不起,问题已经找到了 此处 在专门针对 CKeditorSymfony2 的帖子中.

Sorry for the question, the answer has been found here in a post dedicated to the CKeditor and Symfony2.

在实践中,问题是由于默认情况下在控制器内部创建的 textarea 具有 required=true 值.然后,我只将 textarea 小部件设置为 false,现在它可以工作了!

In practice, the problem is due to the fact that the textarea was created inside the controller with a required=true value by default. Then, I only set the textarea widget to false and now it works!

事实上,TinyMCE 库(和其他库一样)只是将默认文本区域设为隐藏,并将其富文本区域添加到 html 页面.所以,浏览器还是需要一些textarea被hydden时不能传递的值!

In fact, the TinyMCE library (like the others) simply makes the default textarea as hidden and add its rich textarea to the html page. So, the browser still need some value for the textarea that cannot be passed when the textarea is hydden!

这篇关于无法使用 Symfony2 和 TinyMCE 提交表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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