Menu
I’m building a shopping cart that can have one or many lines of items, each with a single text field displaying the Quantity of that line.
When a quantity is changed, I need to know what it was changed to.
Each text field does have a unique name which I’m successfully loading to a variable. With the variable knowing the name of the field, how do I load the value to another variable?
Essentially, where XXX is a changing field name, I’m trying to resolve:
var newvalue = document.cart.XXX.value
I’m stumbling on how to add the variable bearing the field name into the equation.