I have a modal dialog in my App that contains about 10 inputs (i.e. text, dates, number and select inputs). I need know if value of any of the widget changed by the user, so that when they click on the cancel button I can prompt them if they like to save changes before closing the dialogue window.
I can do this in two ways, which may not be the smartest way:
1) set a global variable in my javaScript and keep track in "onChange" event.
2) Compare the value of each widget or inputs before and after to determine if any of them changed.
I wonder if there are any other options that I am not aware of since I am new to jQuery and javaScript.
I apologize if this a duplicate question, I searched and found another similar issue but not what I am after. Best way to track onchange as-you-type in input type="text"?
Thanks