Setting and calling a variable in a view

By: Shawn Fawcett | Asked: 05/11/2023
ForumsCategory: General questionsSetting and calling a variable in a view
Shawn Fawcett asked 1 year ago

Hello,

In the example below I would like to use the result of a calculation "Total square feet needed" and store it as a variable rather than having to retype the equation each time. How can I set the result as a variable and how can I call it? This is all being done in a view.

On the same note, I would like to set a price per square foot as a variable to be called in calculations. How can I do this (if it is different than my first question)?

***

Total square feet: [327]

Total square feet needed (including waste/cuts):  [frm-math decimal=2][327]*(1.1)[/frm-math]  

Price per square foot: $1.00  

Total cost = "Total square feet needed" * "Price per square foot"  

If total square feet is 1000, then square feet needed is 1100 and the total is $1100  

1 Answers
Victor Font answered 1 year ago
Set the formula as a default value for a hidden field. The field will store the result.
Shawn Fawcett replied 1 year ago

So all in the form then. Thanks Victor

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right