Is it possible to somehow get at what USED TO BE in a text area? (possibly from onChange event)
When Javascript is deciding to fire the onChange event of a TextArea element, it obviously has access to the original (unedited) text as well as the new text to see if it is different. Is the old text it compares available once the event is fired?
Specifically, I’m trying to let multiple users edit fields in a database. Currently, I show them the field in a TextArea and in the onChange event handler I call a webservice to update the DB. The webservice does it’s best to merge edits from multiple users and append to (rather than overwrite) what other users have done. The webservice could use some more info to do it’s job better. Specifically, if it knew not just what the user has in the field after editing (the .value or .innerHTML when in the onChange event handler) but what they saw before editing, it could then try to determine what edits this user is trying to make. By comparing Old and New, the web service could isolate only the things this user was trying to change and make those updates without also re-asserting the original value of text they didn’t change (so probably didn’t care about).
Is this possible or does JavaScript keep the goods for itself, discarding the old text as soon as it has made it’s decision to fire the onChange event?
Thanks