Logo
  • Pricing
  • Help
  • Contacts
Log In Get Started

Calculator in the forms

What the calculator can do

The calculator lets your visitors estimate prices, amounts, or other values in real time. As soon as they fill in the fields, the calculator applies your predefined formula and displays the result right away.

NOTE

The calculator works exclusively with numeric values (see the table below).


Main features

  • 1 The calculator computes values from the data users enter, following the formula you predefine.
  • 2 The “Calculation result” field supports mathematical operators and self-executing JavaScript.
  • 3 Results can be displayed anywhere on the page by inserting a variable that looks like:

{{ form.ID.variableName.value }}
or
{{ form.ID.variableName.text }}.

  • 4 A field value can be passed into the Hidden field of another form on the same page.
  • 5 One result can be used as the basis for another calculation. This is useful for showing intermediate values, such as the original price and the discounted price.

NOTE

The calculator is available only in vertical forms.

Horizontal forms and quizzes are not supported.


How to add a calculator to your form

To add a calculator to any form on Flexbe, do the following:

Step 1. Go to the Elements catalog and add a vertical form

How to add a calculator to your form. Step 1
CLICK TO ZOOM IN

Step 2. Add the fields you need

Build your calculator using any of the supported field types marked with the special icon (Number, Checkbox, Radio, Select, Slider, Calculation result, Hidden field). To include a field in the calculation, simply switch its toggle on.

How to add a calculator to your form. Step 2
CLICK TO ZOOM IN

Step 3. Assign variable names for all calculator fields

When setting up a field, give its variable an easy-to-understand name to use it in your formula. Make sure every variable has a unique name within the same form.

How to add a calculator to your form. Step 3
CLICK TO ZOOM IN

NOTE

Use only Latin letters when naming variables.

Step 4. Add the “Calculation result” field

Add a Calculation result field to your form. Then enter the formula you want to use in its settings.

How to add a calculator to your form. Step 4
CLICK TO ZOOM IN

You can reuse this result in other formulas, for example, to calculate a discount.

Step 5. Save and check the formula

Save your changes and switch to the preview mode to make sure the calculator works correctly.

You can disable the Submit button in the form. It’s useful if you want visitors to see the calculation results without sending the form.


Creating an example calculator

Let’s build a window installation calculator that allows visitors to estimate the cost of a window along with additional options and installation fees.

We start by adding the necessary fields, enabling them for calculations, and giving each variable a unique name:

  • Window height (height)
  • Window width (width)
  • Price per sq.ft. (price)
  • Additional options (options)
  • Installation fee (installation)

Then we add the Calculation result field with this formula:

(height * width * price) + options + installation

The calculator now shows the window cost in real time, using the details the visitor provides.


Using variables anywhere on the page

You can output calculator variables anywhere on the page, for example, inside the text or in the Hidden fields of other forms. Here’s how you can do this.

Step 1. Copy the variable from the calculation result settings.

You can choose between two options: All text or Value only.

Using variables anywhere on the page. Step 1
CLICK TO ZOOM IN

Step 2. Paste the copied value to any place on the page where you want it to appear.

Using variables anywhere on the page. Step 2
CLICK TO ZOOM IN

TIP

Variables work in texts, button labels, Hidden fields of other forms, etc.


Supported mathematical operators

You can use the following math operators for your formulas:

  • width^2 or width**2 — raise to the nth power
  • sqrt(width) — square root
  • min(width, 10) — minimum value
  • and more (see the table below)
OperatorDescriptionExample
sqrtReturns the square root of a numbersqrt(9) → 3
cbrtReturns the cube root of a numbercbrt(27) → 3
absReturns the absolute value of a numberabs(-5) → 5
sinSine of an angle (in radians)sin(Math.PI / 2) → 1
cosCosine of an angle (in radians)cos(0) → 1
tanTangent of an angle (in radians)tan(Math.PI / 4) → 1
asinArcsine: returns the angle in radiansasin(1) → Math.PI / 2
acosArccosine: returns the angle in radiansacos(1) → 0
atanArctangent: returns the angle in radiansatan(1) → Math.PI / 4
logNatural logarithm (base e)log(Math.E) → 1
log10Base-10 logarithmlog10(1000) → 3
expReturns e raised to the power of x*exp(2) → Math.E ** 2
floorRounds down to the nearest integer (floor)floor(4.9) → 4
ceilRounds up to the nearest integer (ceiling)ceil(4.1) → 5
roundRounds to the nearest integerround(4.6) → 5
truncTruncates the fractional part of a numbertrunc(4.9) → 4
signReturns the sign of a number (-1, 0, 1)sign(-8) → -1
maxReturns the maximum of the argumentsmax(3, 7, 2) → 7
minReturns the minimum of the argumentsmin(3, 7, 2) → 2


Table of supported fields

Field typeCalculation features
CheckboxAll selected values are summed up
SelectAll selected values are summed up
Slider rangeSupported without including the range of values
ListNo special features
NumberNo special features
Hidden fieldNo special features



Product

  • Features
  • Pricing

Resources

  • Help
  • Logo Maker

Company

  • Terms of Service
  • Privacy Policy
  • Cookie Policy

Contacts

info@flexbe.com

© 2012–2025 Flexbe Inc.
Instagram
Loading...