I have an INPUT text box.
As someone types into the INPUT text box, i need it to append/add-to a TEXTAREA value.
Lets say user types '12345' into the text box.
The textarea (default value="Comment: ") will automatically add: 'Comment: 12345'. Adding '12345' as they type.
Russ Cam is missing an edge case -- you can drag and drop text into and within input fields by highlighting and dragging, which his code does not account for.
Below code that covers this case:
That said, there is still another edge case, which is deleting and manipulating via context menu. As of right now I can't see a way to detect the selection of context menu interaction... You could disable it if that is important using the following code
Assuming
area
is the id of your textarea andtext
the id of your textbox,