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 2694 Sep 12, 2001, 3:38 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2664 Sep 12, 2001, 5:23 AM
Thread Re: [wil] Bug or intended?
Paul 2629 Sep 12, 2001, 6:36 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2628 Sep 12, 2001, 7:13 AM
Thread Re: [wil] Bug or intended?
Paul 2626 Sep 12, 2001, 7:20 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2644 Sep 12, 2001, 8:32 AM
Thread Re: [wil] Bug or intended?
Paul 2606 Sep 12, 2001, 8:45 AM
Thread Re: [PaulWilson] Bug or intended?
Wil 2602 Sep 12, 2001, 8:57 AM
Post Re: [wil] Bug or intended?
Paul 2617 Sep 12, 2001, 9:34 AM
Post Re: [PaulWilson] Bug or intended?
QooQ 2630 Sep 12, 2001, 5:35 AM
Thread Re: [PaulWilson] Bug or intended?
Jagerman 2620 Sep 12, 2001, 12:05 PM
Post Re: [jagerman] Bug or intended?
Paul 2583 Sep 12, 2001, 12:10 PM