I have an <input type="text"> into which users enter symbolic logic expressions, where the non-keyboard logical symbols are supplied by a short array of buttons. The click functions for these buttons use the getSelection and replaceSelection functions from the rather ancient fieldSelection plugin. In particular, they allow for in-place editing of data already entered into the text box, whereas without their use button-click entry would only append to the END of what has already been entered, regardless of where the caret is located. I've had to cobble on my own setSelection function to the plugin so that after each button-click entry the caret ends up immediately after what has been entered, whether that is mid-expression (as a result of editing) or at the end of the expression.
My problem arises if the expression being entered is longer than the textbox. Surprisingly, IE6 behaves in the way that I would like, namely, that the contents of the textbox automatically scroll over so that the caret is always visible at the right hand end of the textbox. With FF3 and Opera 9.5, it behaves that way for keyboard entry, but for button-click entry the textbox contents literally and disconcertingly jump back so that the first character of what has already been entered is at the left end of the textbox and the caret is out of view beyond the right hand end of the textbox. Can anyone suggest how I can achieve the desired behavior with FF3 and Opera 9.5? Is there perhaps a more recent alternative to the fieldSelection plugin that could come to my rescue? Ed