I have a table of inputs which I activate and deactivate on double click. Now this inputs are pre-populated with some data from DB. Because the user have to press a button in order to update the DB once they double click an input and change, I would like to store the value of the input just in case the user decides to click another cell after changing without pressing the button I can then replace the value that was not sent for the original. I am using jquery to do this attr toggle to change the inputs readonly but my knowledge in jquery is limited in order to achieve what I want.Here is some example code
Thanks
If I understand the question, you’re looking to store data before a user modifies it, and bring the data back if the user doesn’t save the changes they make.
If I understood the problem correctly, I would use $.data() to maintain the old values. It essentially lets you keep key-value pairs in an html element, so it’s fairly easy to keep a string backup for an input. Add this to dblClick to backup the value:
And add this to return it to the original value: