Forum Discussion
FatmaSayed
9 years agoCommunity Member
java script
please;;;
I want to know how can i write java script code to get sum of 5 variables?????????
WaltHamilton
9 years agoSuper Hero
FYI:
you can do the same thing with triggers, using whatever action you are using to initiate the javascript.
Adjust variable Sum = 0 when user clicks button
Adjust variable Sum ADD Variable 1 when user clicks button
Adjust variable Sum ADD Variable 2 when user clicks button
Adjust variable Sum ADD Variable 3 when user clicks button, etc.
You just need a trigger for each step (6 triggers) that all fire from the same user action.
The advantage of using triggers is that it is easier for someone who doesn't write JS to do maintenance on the module. Also, triggers function in preview mode, while your module must be published for JS to function.
- FatmaSayed9 years agoCommunity Member
Thanks for helping Mr/ Walt Hamilton, this is a piece of cake, and i will use it.
Related Content
- 7 months ago
- 7 months ago
- 4 months ago