homerUK
03-16-2004, 11:28 AM
I am trying to work out a way of returning the character BEFORE the cursor position using an onkeypress command.
for example:
th|
if the pipeline above is the cursor - when the user types the next letter, I want to be able to get the letter before that. So in this case, the script would return "h"
I've tried using some of the following commands:
var code = iView.document.selection;
var tmp = code.createRange();
tmp.expand("character",1);
but nothing seemed to work.
any help is much appreciated.... thanks :)
for example:
th|
if the pipeline above is the cursor - when the user types the next letter, I want to be able to get the letter before that. So in this case, the script would return "h"
I've tried using some of the following commands:
var code = iView.document.selection;
var tmp = code.createRange();
tmp.expand("character",1);
but nothing seemed to work.
any help is much appreciated.... thanks :)