My problem is as follows. I have a form whose data is saved correctly. The problem is that when I am going to update (edit) the data that I saved previously (because I made an error when editing or that I was ...), the new data is not saved when I press save the first time. However when I press save a second time the data if saved. Does someone give me an idea? I leave the fragment of code that corresponds to the function that is triggered at the moment of clicking "save" to update the data. I placed an alert on line 467 to see the value that is being captured by the variable "discount" (which is the one I want to modify), and I effectively capture the correct value from the second time I press save ... in the first Once I capture the old value (the one I had before modifying)