I am developing a web application for a travel agency, in this application the sales are registered, these sales have services that vary the cost of each depending on the client, supplier and / or destination.
In the part where I add these sales I have a form where in several I have a function that captures the onKeyUp event of certain input and calculates the VAT, ish, final price, total markup of the sale, etc.
So far so good, my problem is that I want to add another form to edit that sale and I want to use that same function to not write another function specifically to edit the sale.
How can I differentiate the inputs that have the same name or class but that are of different forms?