I have an editor function where I want to offer a couple different links which will populate the TinyMCE editor with pre-formatted text. With a regular textarea (no editor), this code works perfectly.
<script type="text/javascript"> function addTxt(txt_content) { document.getElementById("textField").value = txt_content; } </script> <textarea id="textField"></textarea><br> <a href="javascript:addTxt('This is sample template text')">Use template text</a>
How can I achieve this same functionality when using the Tiny MCE editor? The same code won't work with TinyMCE editor. I noticed the editor uses tinyEditor_1 and I tried calling that variable too but it didn't work. Any help would be greatly appreciated! |
|
|