5
votes

I'm creating a bunch of inline tinyMCE editors on some span tags, like so

<span class="editor">text here</span>

 <script type="text/javascript">
 tinymce.init({
        selector: ".editor",
        inline: true,
        object_resizing: false,
        toolbar: "undo redo",
        menubar: false,
        forced_root_block: false,
    });
</script>

But I want to make the hidden inputs it automatically generates named something other than mce_[number], so that it'll match what the cakePHP framework expects. I tried just changing the name attribute of those fields with javascript. Sometimes that works, and other times those input fields will not have any data when the form is submitted. Any help?

1

1 Answers

6
votes

tinyMCE will automatically choose the id of div(or span in your case) to be name of hidden input. it will only use mce_# if id is not specified.

<span class="editor" id="DesiredName">text here</span>