In a PDF file, what Javascript code can I use in calculation that could tell if the user edited a field?

In a PDF file, what Javascript code can I use in calculation that could tell if the user edited a field? This field in question calculates what is input into the field based on a drop-down menu. However, I want the users to be able to edit the field if they want. But every time you try to edit the field and click off of it, it goes back to what it was before. So, I figured an easy way to fix it is if there is some variable that tells me if it was either calculated or edited by user, and if edited by user, I would just put an if statement in there to prevent the calculation. If you can think of any other creative solutions to this problem, I would be interested to hear it.