Expression
Expression is a read-only question type used to dynamically calculate values based on user input or predefined variables and display the calculated values in your form or survey. In this demo, expression questions calculate the cost of each pizza based on selected size and quantity and add up the costs to display the total of an order.
To create an Expression question, add an object to the elements
array and specify the following properties within this object:
type
A question type. Set this property to"expression"
.name
A unique name that identifies the question.title
A title for the question.expression
An expression used to calculate the value you want to display (see Expressions).(Optional)
description
Explanatory text displayed under the title.
Refer to the json.js
file listing for more information.