W3C home > Mailing lists > Public > www-forms-editor@w3.org > October 2003

Re: textarea and textbox DOM API

From: Frank Boumphrey <boumphreyfr@agentbrand.com>
Date: Wed, 1 Oct 2003 12:52:42 -0400
Message-ID: <000001c3883e$2ae5f7d0$0300a8c0@D1C4FN01>
To: "Mark Birbeck" <Mark.Birbeck@x-port.net>
Cc: <www-forms-editor@w3.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 10 June 2009 18:12:12 GMT