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
Post a Comment