I have a Form named jobcard with fields like “Service”, “addon1”, “addon2” etc, each just linking to the service and addon tables respectively and also displaying the price when selected.
I also have a Total field that i want to be updated when “Service” and “Addons” are selected.
I created a phpmethod named SumTotal with {total} = {serviceid} = {addon1id}
and then added SumTotal(); in the OnScriptinit and also added new ajax events on “Serviceid” change and “addon1” change. (only trying service and addon1 addition first, for testing and then will add the other addons.)
i have also selected “Reload form when value has changed” on service selection and addon2 selection.
it does not seem to update the total field. i suspect its because i am selecting the serviceid and addon id and not the price (int)
serviceid SQL statement:
SELECT id, sc_concat(name, desc
, price)
FROM services
ORDER BY name, desc
, price
addon1 SQL Statement:
SELECT id, sc_concat(name, description, price)
FROM addons
ORDER BY name, description, price
Can someone please suggest a better way to achieve this, code examples will sincerely be appreciated.