How's it going?

Does anybody please know how to create a variable in Javascript that is created only when a user has edited one of the fields in a form (can assume all form types are text areas).

I'd then like to be able to gain access to this variable on the next page (i.e. after the form button is pressed), so that this variable can tell me whether or not the user has edited any of the form details.

Then depending upon the value of this variable, the records are updated in the database.

Please note, all the database stuff is being done with PHP, I'd just like to know how to create the variable, if possible.

Many thanks if you can help,