1

我正在尝试添加一个 textarea 并动态激活它

tinyMCE.execCommand('mceAddControl', false,'id')

我已经在其他 textarea 上尝试过,效果很好,但不适用于这个特定的 textarea:

'id_sguidepoint_set-'+index+'-gp_description'

会不会是名字太大了?还是因为某些字符在 tinyMCE 中无效?

这是我的 tinyMCE 初始配置:

tinyMCE.init({
            mode : "textareas",
            theme : "advanced",
            plugins : "emotions,spellchecker,advhr,insertdatetime,preview,jbimages", 

            // Theme options - button# indicated the row# only
            theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,fontselect,fontsizeselect,formatselect",
            theme_advanced_buttons2 : "cut,copy,paste,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,jbimages,|,code,preview,|,forecolor,backcolor",
            theme_advanced_buttons3 : "insertdate,inserttime,|,spellchecker,advhr,,removeformat,|,sub,sup,|,charmap,emotions",      
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_resizing : false ,
            relative_urls : false
    });

这是我要激活的元素:

<textarea id="id_sguidepoint_set-3-gp_description" rows="10" cols="40" name="sguidepoint_set-3-gp_description" style="display: none; " aria-hidden="true"></textarea>

显然有不止一个文本区域,这就是为什么我必须使用索引来遍历它们

任何帮助将不胜感激

提前致谢

4

1 回答 1

2

好的,在尝试了很多不同的事情之后,我发现我的问题是 textarea 被隐藏了:

style= "display: none"

这就是问题所在,因为可以绘制文本区域,所以一切正常。

我希望它对遇到相同问题的其他人有所帮助。

问候

于 2012-08-21T14:02:25.043 回答