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?
Running the setContent() function on specifically editorOne with the tinymce. get('editorOne'). setContent(contentOne); method, you can change just editorOne.
Selector engine, enables you to select controls by using CSS like expressions. We currently only support basic CSS expressions to reduce the size of the core and the ones we support should be enough for most cases.
You can do this using the setContent() method from the TinyMCE API.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With