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 2463 Sep 12, 2001, 3:38 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2442 Sep 12, 2001, 5:23 AM
Thread Re: [wil] Bug or intended?
Paul 2405 Sep 12, 2001, 6:36 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2406 Sep 12, 2001, 7:13 AM
Thread Re: [wil] Bug or intended?
Paul 2404 Sep 12, 2001, 7:20 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2422 Sep 12, 2001, 8:32 AM
Thread Re: [wil] Bug or intended?
Paul 2384 Sep 12, 2001, 8:45 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2380 Sep 12, 2001, 8:57 AM
Post Re: [wil] Bug or intended?
Paul 2395 Sep 12, 2001, 9:34 AM
Post Re: [PaulWilson] Bug or intended?
QooQ 2408 Sep 12, 2001, 5:35 AM
Thread Re: [PaulWilson] Bug or intended?
Jagerman 2398 Sep 12, 2001, 12:05 PM
Post Re: [jagerman] Bug or intended?
Paul 2361 Sep 12, 2001, 12:10 PM