Re: textarea and textbox DOM API

Mark,
Thanks for your reply.

Certainly (if implemented) DOM Range would allow one to manipulate the
textnode of an xhtml textarea element, however it would still not provide
the means for a user to manipulate text in the textbox.

In fact the text in the text box can already be manipulated by standard
Javascript text methods, but what is needed  is a series of event properties
that allow the application to discover what the user is doing with the text
cursor.

At a minimum one needs to know the position or start position of the text
cursor within the box, and the number of characters selected. If we had that
we could write code to do all the rest.
For example if the text between the carets was highlighted:

Lorem ip^sum^ dolor sit amet,

getPosCursor()   or getSelTextStart()  ...would return 8

getSelTextLen() ...would return 3

Frank
Frank Boumphrey
(Latest Book co-authored 'XML.NET Developers Guide' from Syngress Press by
Sills, Boumphrey and Ortiz)

Received on Wednesday, 1 October 2003 13:10:24 UTC