Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Bug or intended?

Quote Reply
Bug or intended?
Hi,

When clicking the smilie images to insert the code automatically into posts (and the other markup), the code is forced to the bottom of the message no matter where your cursor is.

I think it would be better to insert the code at the cursors position.

This code should do that:

Code:
function storeCaret (html)
{
if (html.createTextRange)
html.caretPos = document.selection.createRange().duplicate();
}
function insertAtCaret (text) {
if (document.Sign.html.caretPos)
{
var caretPos = document.Sign.html.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
}
else
alert("You must click in the text area before you can insert html");
}

.......then you want something like:

Code:
<input type="button" onclick="insertAtCaret(' ');" value="Bold">


Last edited by:

jagerman: Sep 14, 2001, 2:46 PM
Subject Author Views Date
Thread Bug or intended? Paul 3039 Sep 12, 2001, 3:38 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2998 Sep 12, 2001, 5:23 AM
Thread Re: [wil] Bug or intended?
Paul 2964 Sep 12, 2001, 6:36 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2962 Sep 12, 2001, 7:13 AM
Thread Re: [wil] Bug or intended?
Paul 2955 Sep 12, 2001, 7:20 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2977 Sep 12, 2001, 8:32 AM
Thread Re: [wil] Bug or intended?
Paul 2937 Sep 12, 2001, 8:45 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2933 Sep 12, 2001, 8:57 AM
Post Re: [wil] Bug or intended?
Paul 2948 Sep 12, 2001, 9:34 AM
Post Re: [PaulWilson] Bug or intended?
QooQ 2969 Sep 12, 2001, 5:35 AM
Thread Re: [PaulWilson] Bug or intended?
Jagerman 2951 Sep 12, 2001, 12:05 PM
Post Re: [jagerman] Bug or intended?
Paul 2916 Sep 12, 2001, 12:10 PM