View Full Version : To determine cursor positin in editable text
epopov
12-29-2003, 08:53 AM
Hi,
how to determine cursor position in editable inputtext?
For example I write "The matrix" and I placed cursor before 'm' char. How can I determine using script than cursor is before 'm' char?
antun
12-29-2003, 11:41 AM
There isn't an API for determining input-cursor position in an inputtext field at the moment, but there will be in the next release.
-Antun
i.e. editext has value "mytext value" and I want to put text cursor position after "x" regardless of its current position.
antun
01-27-2005, 01:45 PM
<inputtext> has a setSelection() method that you can call to position the cursor at a given location.
I believe that this method is not exposed at the top of <edittext>, you you could call the setSelection on the <inputtext> inside of <edittext> by doing field.setSelection().
BTW, there's getSelection() and getSelectionSize() methods too now.
-Antun
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.