Calculator Forms for E-commerce

Edit in →
Survey Creator

Calculator forms are interactive e-forms that incorporate expression-based calculations into their functionality. They allow respondents to input data or make selections that are then processed in real-time to produce calculated results. For instance, a calculator form on a grocery shop website helps buyers determine the total cost of selected items. This demo shows how to build a calculator form that contains a catalog of item images with names and costs (vegetables in our example). Once a user selects an item they want to purchase, a related dropdown appears, allowing them to select the quantity. The total cost of all selected items is displayed at the bottom of the form and automatically updates with each modification.

Arrange Elements on the Form

To build the layout described above, use Panel elements with an Image Picker and a Dropdown questions inside. Each Image Picker should contain only one image and enable the multiSelect property to let respondents both select and unselect the image. Each Dropdown should become visible only when respondents select an image to which it is attached. Use the visibleIf property to control the visibility.

Perform Calculations

To calculate the price of each product, add an Expression question to each Panel. Use this question multiply the price of one kilogram by the selected number of kilograms. Because this question will only be used in calculations, set its visible property to false.

To compute the total price, create a calculated value that adds up all expression values. You can use an HTML question to display the calculated value. To exclude unselected products from the final calculation, set SurveyModel's clearInvisibleValues property to "onHidden".

Refer to the survey JSON schema (the json.js file) for a code example.

Your cookie settings

We use cookies on our site to make your browsing experience more convenient and personal. In some cases, they are essential to making the site work properly. By clicking "Accept All", you consent to the use of all cookies in accordance with our Terms of Use & Privacy Statement. However, you may visit "Cookie settings" to provide a controlled consent.

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.