I am looking to see if any one knows how to create a form that has a calculator attached. I need to create a Quote form and would like to have a total box at the end with an estimated amount.
Do you actually need a calculator embedded in the page? Or do you just want to calculate the the quote from the data on the form?
I would like the data entered in the form to automatically calculate, which i have learned to do. However, as a payroll company each frequency is a different price, which i know how to make each of those different. But the issue i am having is that for a frequency of weekly the cost is $21.95 weekly base charge plus $1.35 per employee, bi-weekly is $31.95 bi-weekly base charge plus $1.50 per employee. What i NEED is for the calculator to recognize the the frequency chosen will change the cost per employee.
That’s not really a Wix Code question, it’s just a matter of writing the correct Javascript formula which applies the frequency chosen to the cost per employee. Create a function that calculates the price based on all of the relevant variable, and call it whenever a value changes.
Could you explain rather on how to set that up?
Each component needs an event handler that will “capture” the latest value. For example, for an input field, you would need an onKeyPress() event handler to get the latest value of the input field. Other components might use onClick() or onChange() . In each of the event handlers you need to get the new value of that component, and then recalculate based on existing values together with the new value.
Do you know if there is some type of video or instruction page that i can go to to learn how to do this?
Hi there,
You can refer to this example for step-by-step instructions on how to implement calculations on your page. It shows you how to do simple arithmetics such as sum and multiply.
Good luck!
Ben