开发者

tinymce - how to set the focus to the first editor on a page with multiple editors?

开发者 https://www.devze.com 2023-04-09 15:59 出处:网络
if I have more than one tinymce editor on a page, every action I do goes to the last editor unless I explicitly click on the ed开发者_如何学Citor I want to edit.For example, I made a plugin, which dis

if I have more than one tinymce editor on a page, every action I do goes to the last editor unless I explicitly click on the ed开发者_如何学Citor I want to edit. For example, I made a plugin, which displays a dialog box, I type something in the dialog box and it should go to the first editor (I launch the dialog box from the first editor) but it goes to the last one, as it is the currently active editor.

How do I make the first editor active, once the page is loaded?


try this

tinyMCE.execInstanceCommand("mce_editor_0", "mceFocus");

taken from here


If you have multiple tinyMCE forms on one page, I recommend
Command: runScript
Target: tinyMCE.get('textarea_id').setContent('Your Text')

0

精彩评论

暂无评论...
验证码 换一张
取 消