I have trawled the internet for a solution to this one . All I need is the
caret position as a number. I have seen quite a few text insertion functions
that do something like this :
textarea.caretPos = document.selection.createRange().duplicate()
and then operate on the caretPos object - but all these solutions seem to
work by creating a selected area in the text and then replacing it - I just
want the caret position as a number.
Anyone got any clues?
Thanks
|
|
0
|
|
|
|
Reply
|
torch
|
6/12/2004 5:05:30 AM |
|
"torch" <torch@torch.com> wrote in message
news:cae2tt$nao$1@newsg4.svr.pol.co.uk...
> I have trawled the internet for a solution to this one . All I need is the
> caret position as a number.
See this thread (url may wrap):
<URL:
http://groups.google.com/groups?threadm=407716b1%240%2464635%244a441750%40ne
ws.wanadoo.nl >
HTH
Ivo
|
|
0
|
|
|
|
Reply
|
Ivo
|
6/13/2004 3:16:28 PM
|
|
On Sun, 13 Jun 2004 17:16:28 +0200, Ivo wrote:
> http://groups.google.com/groups?threadm=407716b1%240%2464635%244a441750%40ne
> ws.wanadoo.nl
Also, try this alternate..
<http://groups.google.com/groups?th=296d438401e265d5>
(shrugs) I have been practising the 'black art'
of shortening Google Usenet URL's recently and
have become quite good at it. ..Maybe I should
write a page on it.
--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
|
|
0
|
|
|
|
Reply
|
Andrew
|
6/13/2004 3:31:39 PM
|
|
"Andrew Thompson" wrote
> Ivo wrote:
> >
http://groups.google.com/groups?threadm=407716b1%240%2464635%244a441750%40ne
> > ws.wanadoo.nl
>
> Also, try this alternate..
> <http://groups.google.com/groups?th=296d438401e265d5>
>
> (shrugs) I have been practising the 'black art'
> of shortening Google Usenet URL's recently and
> have become quite good at it. ..Maybe I should
> write a page on it.
Yes, please do. This is impressive.
Ivo
|
|
0
|
|
|
|
Reply
|
Ivo
|
6/13/2004 4:25:27 PM
|
|
torch wrote:
> I have trawled the internet for a solution to this one . All I need is the
> caret position as a number. I have seen quite a few text insertion functions
> that do something like this :
>
> textarea.caretPos = document.selection.createRange().duplicate()
>
> and then operate on the caretPos object - but all these solutions seem to
> work by creating a selected area in the text and then replacing it - I just
> want the caret position as a number.
>
> Anyone got any clues?
In the IE DOM, TextRange objects have a boundingLeft property.
Reads to me as it was what you are looking for:
<http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/duplicate.asp>
In the Gecko DOM, HTMLTextAreaElement objects have a selectionStart
property:
<http://www.xulplanet.com/references/objref/HTMLTextAreaElement.html>
HTH
PointedEars
|
|
0
|
|
|
|
Reply
|
Thomas
|
6/20/2004 12:13:10 PM
|
|