An example of building a form with a "multiple" type calculator.

A feature of this type of calculator is the binding of mathematical logic to the id of the form fields. This is a flexible option that can display any number of calculation results. It supports logical operations, the distribution of mathematics between fields and the defining formula.

This example does not contain complex mathematical structures and a large number of fields, it shows the principle of operation as simply as possible.


The formula for this calculator is:

408.4 = {408.2};
408.5 = {408.1} * {408.2}

408.4 and 408.5 - this is the id of the special fields "calculatorSum" (two of them). One displays the number of days, the second displays the product of the number of days by the tariff. {408.2} - this is the id of the calendar field. {408.1} -id of the apartment class selection radio group. The "math" radio button contains the daily rate.

The expression 408.5 = {408.1} * {408.2} literally means: write in the field with id 408.5 "math" of field {408.1} multiplied by "math" of field {408.2}.

Installation order.

  • 1. Download file
  • 2. Import the file through the project manager of the QuickForm component.
  • 3. Display the form on a website page (more).

Download: KB)