Undo and Only Allow Deletes in Textarea
Posted on 2003-11-18
I need to create a text area that will provide very limited editing capabilities to our users. The textarea will come prefilled with text. I want to give users the ability to ONLY delete text from the textarea, not to add any text. I have generally figured out how to do this, by disabling all keys except delete/backspace and the arrow keys. One thing I have not been able to turn off, however, it the right-mouse-click paste feature, which will paste text, notwithstanding the disabling of other keys. I want the paste disabled JUST for the textarea (there will be other stuff on the page).
Related to this, I want to give users the ability to undo (redo is not important) any deletions they have made, such as by including an undo button under the textarea. (there can be an unlimited number of undos). However, I have not been able to figure out how to do this.