I have searched high and low and cannot find any help out there. After developing a custom module that allows people to enter some information, there are some fields I would like to auto-calculate based on the change of another field.
Here are my fields:
UPC (textbox)
ItemQty (textbox)
ItemOrigPrice (label)
ItemTotPrice (textbox)
Upon scanning the UPC, the ItemQty defaults to 1, ItemOrigPrice displays the price, and ItemTotPrice defaults to ItemOrigPrice.
I would like it to auto calculate the ItemTotPrice upon changing the ItemQty. I have seen this done in a regular HTML form and some Javascrpit but I am having issues with having the Javascript refer to the ASP.NET tags. In the example that I saw, the Javascript refers to the HTML field name but when I try to change the to refer to the ASP.NET tag Id, it does not work. I would also like to keep it Client-side so it does not require a postback.
Example:
ItemQty :: 1 changed to 3
ItemOrigPrice :: $20.00
ItemTotPrice :: $20.00 changed to $60.00
ItemQty * ItemOrigPrice = ItemTotPrice
I hope all of this makes sense. Can anyone shed some light on this for me please? I appreciate any feedback provided to me. Thank you.