Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2009-06-02 02:39:31

clone_element
New member
Registered: 2009-06-01
Posts: 1

Clone textarea with cloneNode and then appendChild

Hello,

need a solution for cloning textarea element with xinha editor inside.

I have more than one textarea field, with array like names (name="my_name[]").
First I'm initializing xinha like this,

xinha_editors = xinha_editors ? xinha_editors : document.getElementsByTagName('textarea');

so that all textareas is with xinha inside.

Then I'm using javascript to clone (add) the similar textarea element on the fly, without needing to reload page.
I'm using methods like "cloneNode" (cloning already existing textarea element with xinha) and then "appendChild" (appending the list of textarea elements with the cloned one).

Problem is that cloned element is with xinha editor inside, but it's not active (not initialized?).

I have Xinha 0.95.

Please help.
Thanks.

Offline

Board footer

Powered by FluxBB