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 2729 Sep 12, 2001, 3:38 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2696 Sep 12, 2001, 5:23 AM
Thread Re: [wil] Bug or intended?
Paul 2663 Sep 12, 2001, 6:36 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2660 Sep 12, 2001, 7:13 AM
Thread Re: [wil] Bug or intended?
Paul 2658 Sep 12, 2001, 7:20 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2676 Sep 12, 2001, 8:32 AM
Thread Re: [wil] Bug or intended?
Paul 2638 Sep 12, 2001, 8:45 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2634 Sep 12, 2001, 8:57 AM
Post Re: [wil] Bug or intended?
Paul 2649 Sep 12, 2001, 9:34 AM
Post Re: [PaulWilson] Bug or intended?
QooQ 2665 Sep 12, 2001, 5:35 AM
Thread Re: [PaulWilson] Bug or intended?
Jagerman 2652 Sep 12, 2001, 12:05 PM
Post Re: [jagerman] Bug or intended?
Paul 2615 Sep 12, 2001, 12:10 PM