E
E
Evgeny Shevtsov2016-03-11 14:33:32
JavaScript
Evgeny Shevtsov, 2016-03-11 14:33:32

How to force the tinymce editor to be added to dynamic textarea?

I add textarea by button

$('#add').click(function() {
    $('<textarea id="'+i+'" name="option[]"></textarea>').fadeIn('slow').appendTo('#ftable');        
    i++;    
});


I tried to call tinymce.init immediately after adding a textarea - it works every other time (for example, I added 4 textarea, and the editor was assigned only to the 2nd ones - after 1).

Here is a test version - https://jsfiddle.net/morrowinds/z9fhqfx6/1/

And here is a semi-working version that I have already described - https://jsfiddle.net/morrowinds/z9fhqfx6/2/

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Zuev, 2016-03-11
@Rattlesneyk

Well, you can try to generate an id according to the standard and use execCommand
Sandbox

V
Vladlen Grachev, 2014-12-28
@AnnTHony

Well, this is a banal ip. For example, this regular expression is fine:
With the port, decide depending on the task. If it is always 80 there, you can get by with the above. Otherwise, something like the following:
((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5] |2[0-4]\d|[01]?\d\d?)(:\d+)?

E
Eugene, 2014-12-28
@Nc_Soft

If you need to parse, then parse as xml.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question