Reputation: 205
I am trying to add a textarea and dynamically active it with
tinyMCE.execCommand('mceAddControl', false,'id')
I have tried it with other textareas and it works great, but is not working with this specific textarea:
'id_sguidepoint_set-'+index+'-gp_description'
Could it be that the name is too big? Or because some of the characters are not valid in tinyMCE?
Here is my tinyMCE initial configuration:
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
});
and this is the element that I want to activate:
<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>
Obviously there are more than one textarea, that is why I have to use an index to iterate through them
Any help will be really appreciated
Thanks in advance
Upvotes: 1
Views: 800
Reputation: 205
Ok, after trying a lot of different thing I figured out that my problem was that the textarea was hidden:
style= "display: none"
So that was the problem, since the textarea can be drawn everything is ok.
I hope it helps to other people that comes with the same issue.
Regards
Upvotes: 2