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 4365 Sep 12, 2001, 3:38 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 4285 Sep 12, 2001, 5:23 AM
Thread Re: [wil] Bug or intended?
Paul 4249 Sep 12, 2001, 6:36 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 4247 Sep 12, 2001, 7:13 AM
Thread Re: [wil] Bug or intended?
Paul 4241 Sep 12, 2001, 7:20 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 4262 Sep 12, 2001, 8:32 AM
Thread Re: [wil] Bug or intended?
Paul 4223 Sep 12, 2001, 8:45 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 4220 Sep 12, 2001, 8:57 AM
Post Re: [wil] Bug or intended?
Paul 4235 Sep 12, 2001, 9:34 AM
Post Re: [PaulWilson] Bug or intended?
QooQ 4254 Sep 12, 2001, 5:35 AM
Thread Re: [PaulWilson] Bug or intended?
Jagerman 4237 Sep 12, 2001, 12:05 PM
Post Re: [jagerman] Bug or intended?
Paul 4203 Sep 12, 2001, 12:10 PM