Multiple instances of tinyMCE on fields with same ID

雨燕双飞 提交于 2019-12-10 15:54:38

问题


We have multiple copies of the same form (jobs for a resume, only hidden "job_id" field changes on each) and we want to use tinyMCE for the description textarea field.

On each form the description field is called "inputDec". TinyMCE seems to fail after one use, despite the fact that each of the forms are different with unique names.

Multiple instances are no problem, but are they possible when the ID is the same -- even if the forms are different -- all on the same page.

Thanks in advance for any suggestions on a way around this issue?


回答1:


Each ID attribute should be unique within the HTML document. Did you try to attach it to the elements with some classname? http://www.tinymce.com/wiki.php/Configuration:editor_selector




回答2:


Basically the same as above, but I'll clarify it abit more :P

Check that:

  • All Forms have different IDs
  • All inputs have different IDs



回答3:


Hide the Instance of the tinymce that it creates by default i.e with the id "mce_0_container" in Css. i.e

mce_0_container{display:none;}

. I have tried it and it worked well for me.



来源:https://stackoverflow.com/questions/9011721/multiple-instances-of-tinymce-on-fields-with-same-id

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