By googling on "textarea onSelect", I found: 1. http://www.firehouse58.com/tools/JSBook/Events/onselect.htm
No mention of selectionStart or selectionEnd.
2. http://www.devguru.com/Technologies/ecmascript/quickref/event.html
Description of events, in general.
3. http://www.devguru.com/Technologies/ecmascript/quickref/evhan_onselect.html
Describes the onSelect event handler. There are two properties of the event: type - the event type target - the object to which the event is being sent
4. http://www.tek-tips.com/gpviewthread.cfm/qid/549806/pid/216/lev2/4/lev3/32
Insertion of text in middle of textarea - I couldn't figure out how to apply it to my case. It may have been IE-specific (I need code which works on Mozilla).
I also tried the Mozilla DOM Inspector, but I don't know how to catch the event object created when I select a substring in order to inspect its attributes.
All this stuff seems to be documented (if at all) only in high priest experts' areas in the WWW. :-(
I'm continuing to google for more keywords, but in the meanwhile if anyone stands up and shouts the solution, this will be appreciated.
--- Omer My opinions, as expressed in this E-mail message, are mine alone. They do not represent the official policy of any organization with which I may be affiliated in any way. WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html
Ilya Konstantinov wrote:
On Monday 15 September 2003 18:33, Omer Zak wrote:
You mean their graphical position in (x,y), or you mean the positionI mean the position within the text. I couldn't care less about the
within the text?
graphical position.
Try reading the "selectionStart" and "selectionEnd" properties of the HTMLTextArea object. To modify the selected range, use HTMLTextArea's setSelectionRange(start,stop) function. This is probably Mozilla-only API (not in the W3C DOM2 HTML). For the Microsoft version of this, http://
msdn.microsoft.com.
For those kinds of things, Mozilla's DOM Inspector (Tools | Web Development | DOM Inspector) is infinitely useful. Simply load your page inside it, point at any object and see its properties. By switching the right pane's mode, you can see the attributes, the CSS properties, the Javascript properties (and methods) and much more.
================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]