I have a text field in a form. I want the user to be able to click
a DELETE button and have the character at the cursor position deleted.
This would be just as if the user had pressed the Back Space key on the
keyboard... But this is for a kiosk application with no keyboard :-(
so I need to program a delete button.
I have code that lets me insert text at the cursor position.
And I can move the ABSOLUTE cursor position from the start and end.
For example, if my text field looks like this (With | representing the caret):
ABCDEF|GHIJKL
....and I call moveStart('char acter', 1) I get this:
A|BCDEFGHIJKL
I was hoping that I could move the selection RELATIVE to the current position:
var r = my_field.create TextRange();
r.moveStart('ch aracter', -1); // This doesn't work...
r.select();
r.text = "";
Or if I could at least get the cursor or selection coordinates:
var r = my_field.create TextRange();
var LEFT = r.start; // This doesn't work
r.moveStart('ch aracter', LEFT-1);
r.select();
r.text = "";
Mozilla lets you get the selectionStart, but I can't figure out how to
do this for IE. Is there anything like selectionStart in IE?
Yours,
Noah