Hi I am trying to insert a string at the cursor position in the editor.
According to some post that i read in this forum "InsertHtml" is suppose to do just that. But when i use InsertHtml my string gets inserted / appended to the beginning of the editors string. Am i maybe missing something?
Does anybody have any solution for me.
Thanks Wayne
According to some post that i read in this forum "InsertHtml" is suppose to do just that. But when i use InsertHtml my string gets inserted / appended to the beginning of the editors string. Am i maybe missing something?
Does anybody have any solution for me.
Thanks Wayne

RE: FckEditor.InsertHtml() not working
function insertTextAtCaret(text)
{
var Hid = document.all['W_449:USR_HTMLEditor1:USR_TextConstantPicker1:hidHTMLEditorName'];
var editor = FCKeditorAPI.GetInstance(Hid.value + ":FCKeditor1");
editor.InsertHtml(text);
}
RE: FckEditor.InsertHtml() not working
RE: FckEditor.InsertHtml() not working
Write your own InsertHTML-function like this:
function InsertHTML()
{
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
// Check the active editing mode.
if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
{
// Insert the desired HTML.
oEditor.InsertHtml( '- This is some <b>sample</b> HTML -' ) ;
}
else
alert( 'You must be on WYSIWYG mode!' ) ;
}
Change "FCKeditor1" to the name of your instance. And all is well!
RE: FckEditor.InsertHtml() not working
RE: FckEditor.InsertHtml() not working