It sounds really simple but I've scoured the forums and cannot find the answer to this.
I have managed to insert a piece of text/html into the document at the current cursor position (using SetHtml via the API)
But at this point, the cursor is placed at the end of the inserted text.
I now want to move the cursor to the top of the document.
Is there a simple javascript call to do this or do I need to try to emulate a CTRL+HOME key combination which would also do the trick.
Any solutions would be greatly received.
I have managed to insert a piece of text/html into the document at the current cursor position (using SetHtml via the API)
But at this point, the cursor is placed at the end of the inserted text.
I now want to move the cursor to the top of the document.
Is there a simple javascript call to do this or do I need to try to emulate a CTRL+HOME key combination which would also do the trick.
Any solutions would be greatly received.
Re: Move Cursor to the Top of the Page
That is, when I add the piece of HTML to the top of the document during the Page_Load event, when the editor displays in FF, this HTML is simply not showing - it works fine in IE.
I did wonder if the HTML was somehow invalid but I'm sure it is valid.
But - the cursor does appear at the top of the page in both browsers which is what I want!!!
So what I've had to do is output the HTML as a javascript variable and then add the HTML (using the InsertHtml API function) in the FCKeditor_OnComplete function.
Now, in both IE and FF, the text is added perfectly.
But, and this is the crux of my problem, the cursor remains at the end point of the insertion and not at the top of the document.
There are two solutions that I can think of:
(a) somehow move the cursor to the top of the document (surely this can be done?)
(b) simulate a CTRL+HOME key combination that would do the same thing and move the cursor to the top
But I just cannot see how to do this.
Re: Move Cursor to the Top of the Page
if you make a javascript call like: fckobject.focus();
it might put your cursor in top of your document...
if that doesn't work, first focus an other element, like:
fakeobject.focus();
fckobject.focus();
hope it works...
Daan