views:

25

answers:

2

I want to create TinyMCE editor on the page, but it should boot and render only after focus on action. How can I do that, please, can you give advice to me.


Recession

Page may have include scores TinyMCE elements, and page will hang. Therefore, the field should be converted into TinyMCE as needed, initially it's just textarea.

+2  A: 

The first example in the documentation shows how you can toggle the editor on and off in Javascript. Just attach an onclick handler to your <textarea> that turns the editor on. Here's some jQuery-based code that I haven't tested, but should work...

$("textarea").click(function() {
    if (!tinyMCE.get(this.id)) {
        tinyMCE.execCommand('mceAddControl', false, this.id);
    }
 });
Dean Harding
Thank you for response, but it is not exactly what I need, but close. TinyMCE does not have to render on the textarea yet have not clicked on it.
HWTech
+1  A: 

At the manufacturer's site is all there, thanks for the tip-off Dean Harding.

http://tinymce.moxiecode.com/examples/example_12.php

HWTech