具有相同 ID 的字段上的 tinyMCE 的多个实例

发布于 2024-12-29 01:15:28 字数 230 浏览 3 评论 0原文

我们有相同表单的多个副本(简历的职位,每个副本上只有隐藏的“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

偏闹i 2025-01-05 01:15:28

每个 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

我的影子我的梦 2025-01-05 01:15:28

基本上与上面相同,但我会进一步澄清:P

检查:

  • 所有表单都有不同的 ID
  • 所有输入都有不同的 ID

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
嘿哥们儿 2025-01-05 01:15:28

隐藏它默认创建的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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文