加载两个文本区域时 TinyMCE 不起作用 [英] TinyMCE not working when loading two textareas

查看:31
本文介绍了加载两个文本区域时 TinyMCE 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面加载时加载了两个文本区域,这两个文本区域位于同一表格行中.我的 tinyMCE 看起来像这样

I have two textareas that I load when the page loads, these two textareas are in the same table row. My tinyMCE looks like this

            tinyMCE.init({
                mode : "textareas",
                theme : "simple"
            });

出于某种奇怪的原因,只有第一个 textarea 被分配了编辑器,而第二个没有.虽然它只在 Firefox 中这样做.文本区域具有不同的名称并且不包含 id.任何建议将不胜感激.

For some odd reason only the first textarea gets assigned the editor and the second does not. Although it only does this in Firefox. The text areas have different names and don't contain ids. Any advice will be appreciated.

推荐答案

给他们不同的 id.Tinymce 编辑器 id 等于 textareas id;如果不存在 textarea id,则默认使用内容".在您的情况下,两个文本区域.因为当第二个 textarea 被转换为一个 tinymce 编辑器实例时,已经有一个 id 为content"的 tinymce 编辑器 - 它失败了.

Give them different ids. Tinymce editor id is equal to the textareas id; if no textarea id is present "content" is used as default. In your case for both textareas. Because there is already a tinymce editor with id "content" when the second textarea is being converted into a tinymce editor instance - it fails.

这篇关于加载两个文本区域时 TinyMCE 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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