You can write a cusom script but it's not needed.
Go to the "Text Field Properties" of the Target Field, where the Product shoud be appear. There you must choose the calculate Tab. Then you must click to the Radio-Button "Value is the" .. and Chose the product(x) Combobox. After this you must pick the two fields Total and Quantiy and close the properties.