具有相同 ID 的字段上的 tinyMCE 的多个实例
我们有相同表单的多个副本(简历的职位,每个副本上只有隐藏的“job_id”字段发生变化),并且我们希望使用tinyMCE作为描述文本区域字段。
在每个表单上,描述字段称为“inputDec”。尽管每种形式都有不同且具有唯一的名称,但 TinyMCE 在使用一次后似乎会失败。
多个实例没有问题,但是当 ID 相同时(即使表单不同)它们是否可能都在同一页面上。
预先感谢您对解决此问题的方法有何建议?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
每个 ID 属性在 HTML 文档中应该是唯一的。您是否尝试将其附加到具有某些类名的元素? http://www.tinymce.com/wiki.php/Configuration:editor_selector
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
基本上与上面相同,但我会进一步澄清:P
检查:
Basically the same as above, but I'll clarify it abit more :P
Check that:
隐藏它默认创建的tinymce的实例,即在Css中使用id“mce_0_container”。即
mce_0_container{display:none;}
。
我已经尝试过了,它对我来说效果很好。
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.