Can't submit a form with Symfony2 and TinyMCE

元气小坏坏 提交于 2019-12-23 03:17:27

问题


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.

Any idea?


回答1:


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

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!

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!



来源:https://stackoverflow.com/questions/10303431/cant-submit-a-form-with-symfony2-and-tinymce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!