Get value of tinymce textarea with jquery selector
Call tinyMCE.triggerSave(); after that you’ll be able to use jquery selector $(“#yourtextareaID”).val();
Call tinyMCE.triggerSave(); after that you’ll be able to use jquery selector $(“#yourtextareaID”).val();
After spending over 15 hours on this issue (dedication, I know), I found a partial solution that works in FF and Safari, but not in IE. For the moment, this is good enough for me although I might continue working on it in the future. The solution: When inserting HTML at the current caret position, … Read more
For the textarea assign a class=”” to textarea property, this will support for you <script type=”text/javascript”> tinyMCE.init({ //mode : “textareas”, mode : “specific_textareas”, editor_selector : “myTextEditor”, theme : “simple” }); </script> <textarea id=”txtdesc” name=”txtdesc” class=”myTextEditor” rows=”6″ cols=”96″ ></textarea>
Nowadays, you should use the autoresize plugin that comes with tinyMCE. You will have to call tinyMCE like this (jQuery version): $(‘.tinymce’).tinymce({ theme : ‘advanced’, plugins : ‘autoresize’, width: ‘100%’, height: 400, autoresize_min_height: 400, autoresize_max_height: 800, }); I made the experience, that it may be helpful to manually call the resizing in the init_instance_callback to … Read more
With asp.net 4, you’ll need to configure the validation mode in the web.config as well. Set the following as a child of the <system.web> element: <system.Web> … <httpRuntime requestValidationMode=”2.0″/> Asp.Net 4 sets the requestValidationMode to 4.0 by default, which tells the system to perform request validation before the BeginRequst phase of the HTTP request. The … Read more
Problem here is you won’t see anything if you enter text or html into your textarea. Your textarea gets hidden when tinymce gets initialized. What you see then is a content editable iframe, which is used to edit and style content. There are several events which will cause tinymce to write its content to the … Read more
You need to use the content_css setting of tinymce to set a custom css file of your own (make sure this setting points to a valid location of a css file). This file will be inserted in the editor iframes head after all other css settings(files from the core) are inserted there when initialising tinymce … Read more
I had the same problem. In v4 all suggestions above did not work for me, but this did: tinymce.remove(“div.editable”); … regenerated HTML dynamicaly … tinymce.init(…); I use inline editor: tinymce.init({ selector: “div.editable”, inline: true, plugins: [ “advlist autolink lists link image charmap print preview anchor”, “searchreplace visualblocks code fullscreen”, “insertdatetime media table contextmenu paste” ], … Read more
Set convert_urls: false in tiny_mce_init.js, not tiny_mce.js. Early in tiny_mce_init.js you’ll see a call to window.tinyMCE.init passing a bunch of initialisation options. In the Products.TinyMCE I’m looking at, the last option is fix_list_elements: false. Add your option there. Edit: tiny_mce_init.js is no longer used in Products.TinyMCE 1.3.x (Plone 4.3). Instead, override the tinymce-jsonconfiguration browser view, … Read more
To cleanly remove an editor instance and avoid any errors use: tinymce.EditorManager.execCommand(‘mceRemoveControl’,true, editor_id); To reinitialize the instance use: tinymce.EditorManager.execCommand(‘mceAddControl’,true, editor_id); Be aware that when moving TinyMCE editors in the DOM you need to removeControl and addControl too, otherwise it results in JS errors. As of TinyMCE 4 the methods to remove and reinitialize an instance … Read more