javascript - Saving multiple TinyMCE instances -


i have multiple instances of tinymce on 1 page.

i have javascript autosave running in background automatically saves forms in database via post request. works 1 form can set element id in init. however, in scenario, user can have variable number of tinymce forms, having multiple hardcoded element id's not seem practical.

tl;dr: dynamically grab instances of tinymce in same page without knowing instance id. or, other approach save multiple forms in 1 auto_save() function.

the way brett decribed correct. here code may call whenever needed, i.e. in auto_save() function:

for (var = 0; < tinymce.editors.length; i++) {     // need needed here     // example: write content form foreach editor instance     tinymce.editors[i].save(); } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -