How to create a form calculator?

Dear Wix Designers,

Currently, I’m trying to create a form through Wix Code, where my users can fill out a form and get a calculation of the entered information.

Below is my design / layout shown:

I’m very sorry that the page is in Danish. But I’m trying to get a calculation via ‘OnChange’. So if a customer or user changes the value of a dropdown, then a calculation will appear in the box called “Price” (TextInput).

And can these dropdowns communicate with each other: If I want a value of 2 in the first dropdown (value of $ 10 = $ 20) and 3 of the second dropdown (value of $ 20 = $ 60). Then there will be 80 $ in the last box (“Price”).

Should I have created a database? And is there a code that should be easy to code?

1 Like

hi Kenneth,

take a look here: https://www.wix.com/code/home/example/Cascading-Form

there’s a sample that shows how to create a form that interacts with user input.
hope it will set you in the right direction.

BTW, there are other examples there that might be interesting for you to walk through…

Did you ever figure this out? I am trying to make a simple order form with pricing calculations based on the users selection of products, and it’s very hard to find examples that are like what you were trying to do, and I am trying to do. If you did figure it out, could you please post your code?