Hi JCE,
Using javascript how do I set focus on the JCE editor ?
As a bit of background, I'm building a custom component with nested comments. The comment form is loaded in a hidden div and moved (using jQuery .append) to the appropriate container when a reply button is pressed. The field is re-initialised with the following code and it all works fine.
tinyMCE.execCommand('mceRemoveControl',false,'jform_comment');
tinyMCE.execCommand('mceAddControl',false,'jform_comment');
I just can't set the focus on the JCE editor after it's displayed. I've tried the following.
tinymce.activeEditor.focus();
tinymce.EditorManager.get('jform_comment').focus();
tinyMCE.get('jform_comment').getBody().focus();
tinyMCE.get('jform_comment').focus();
I'm sure I'm missing something really simple? Thanks in advance
John