P
Paul Gorodyansky
Hi,
FAQ tells how to insert (or replace0 a text at a caret position in
Mozilla (and same works for Opera 8+), for example, at
http://www.faqts.com/knowledge_base/view.phtml/aid/1661
it talks about that -
....
textControl.setSelectionRange(oldSelectionStart + newText.length,
oldSelectionStart + newText.length);
But this has a problem - if my Textarea is say 10 lines long
and is _full_ and I am trying to insert - programmatically -
some text down below, say in line #12:
I can NOT see what my Javascript code inserts -
the above cited textControl.setSelectionRange()
sets the screen to the very beginning of my Textarea, to the line #1,
so line #12 content goes out of sight...
Is it solvable? May be I can somehow set a focus onto current
caret position, i.e. make line #12 visible after the
insertion/replacement?
Thanks,
Paul
FAQ tells how to insert (or replace0 a text at a caret position in
Mozilla (and same works for Opera 8+), for example, at
http://www.faqts.com/knowledge_base/view.phtml/aid/1661
it talks about that -
....
textControl.setSelectionRange(oldSelectionStart + newText.length,
oldSelectionStart + newText.length);
But this has a problem - if my Textarea is say 10 lines long
and is _full_ and I am trying to insert - programmatically -
some text down below, say in line #12:
I can NOT see what my Javascript code inserts -
the above cited textControl.setSelectionRange()
sets the screen to the very beginning of my Textarea, to the line #1,
so line #12 content goes out of sight...
Is it solvable? May be I can somehow set a focus onto current
caret position, i.e. make line #12 visible after the
insertion/replacement?
Thanks,
Paul