Hi,
I'm new to the FCK Editor and would like to see how to do something I'm sure is quite simple (but I'm not sure how!!).
In a normal textarea I can add an onclick event that will add link to the contents.
<div onclick="document.addcomment.comment.value+='<a href="page.php?assign=5566">5566</a>'">5566</div>
In FCK How would I to have the link appear at the cursor position as the linked highlighted text (non-source view).
I'm new to the FCK Editor and would like to see how to do something I'm sure is quite simple (but I'm not sure how!!).
In a normal textarea I can add an onclick event that will add link to the contents.
<div onclick="document.addcomment.comment.value+='<a href="page.php?assign=5566">5566</a>'">5566</div>
In FCK How would I to have the link appear at the cursor position as the linked highlighted text (non-source view).

Re: Is this easy?
Re: Is this easy?
So I have this and it works in Firefox but in ie6 and ie7 its adding the text to the beginning of the content regardless of where the cursor its.
Can you see where I'm going wrong?
<? include("fckeditor/fckeditor.php"); ?> <html> <head> <script type="text/javascript"> function enterHTML(editorInstance){ var oEditor = FCKeditorAPI.GetInstance(editorInstance) ; oEditor.InsertHtml('test'); } </script> </head> <body> <div onclick="enterHTML('FCKeditor1')">test</div> <form name="setup"> <? $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->BasePath = 'fckeditor/' ; $oFCKeditor->Value = 'Welcome to the FCK editor.' ; $oFCKeditor->Create() ; $oFCKeditor->Config['EnterMode'] = 'br'; ?> <input type="submit" value="Submit"> </form> </body> </html>Re: Is this easy?
Re: Is this easy?
It make the rest of the page unselectable, thus maintaining the cursor position. It wont work for all but will work for me for now. (call onload or place at page end)
<script type="text/javascript"> <!-- if (navigator.appName=="Microsoft Internet Explorer") { var all = document.all; var l = all.length; for (var i = 0; i < l; i++) { if (all[i].tagName != "INPUT" && all[i].tagName != "TEXTAREA" && all[i].tagName != "IFRAME") { all[i].unselectable = "on"; } } } //--> </script>