Script to calculate costs based on drop down field selections
- September 22, 2022
- 1 reply
- 788 views
Hello Adobe Brains Trust,
I am seeking help with a custom calculation script using if, then statements on calculating costs based on the selection of two fields for a client order form (Client_co-payment and Product fields). I'm a JS newbie and I've tried to read through various threads but I dont' have the headspace at the moment to work this out.
We want the clients to see the cost for 2 week, 4 week and 8 week supply of whatever products are prescribed by the clinician so they can choose their preference. The actual cost is dependent on the type of client (not the product cost): $67 per week (general client), $37 per week (concession client) and $23 per month (reduced concession client) - the cost for 2 and 4 week supply is the same ($23) and $45 for 8 week supply for a reduced concession client. This is where I'm coming unstuck as it's not a straight multiplication of the weekly cost as per the general and concession clients.
So, when the clinician selects the Client co-payment amoun, and selects the required products (no invidual pricing), it will automatically populate the costs in the columns called 2 weeks, 4 weeks and 8 weeks for the product/s selected. The cost has been included in the export value field for the Client co-payment drop down options.
I have attached a screen shot of the form. Any assistance would be greatly appreciated. Thank you!
