## Dynamic Values

This field is used to apply a value to an element based on specific conditions. (For example, you have 3 number elements, and the third element is the sum of element 1 and element 2) Assuming the names of these elements are “one”, “two”, and “three”, the Dynamic Value of element “three” will be:(one) + (two)

**Note that the Dynamic Value content needs to be legal JavaScript statements. At run-time, the value of each element will be represented by a local JavaScript variable based on the name of the element.**

**Example Dynamic Values**:

**Default a pick list to the first choice in pick list or select widget (where 0 equals the index value of the first option). Enter the following in the Dynamic Value field of your widget.**

Ex.1

**element_name=0**

Ex. 2

**{0}**

**Performing a calculation on elements, and numerical values.**

Ex.1

**Number(square_footage) / 2400.0 / (1/Number (ceiling_height_feet)) **

Ex.2

**(Number(room_width_feet) + Number(room_length_feet)) * Number(ceiling_height_feet) **

**Using "if" statements with your dynamic statements.**

Ex. 1

**if ((AVBCloses == 0) && (AVBOpens == 0) && (AVBHeight >= 1)) {TestResult = 0} else {TestResult = 1} **

Ex. 2

**if (AGPassFail >= 75) {TestResult = "You Passed"} else if (AGPassFail < 75) {TestResult = "You Failed"}**

## Comments

3 comments

Try this

If (age_at_signup > 14 && age_at_signup<21)

Just a follow up with this,

Im trying to get a range between 2 numbers, the method im using is

If ((age_at_signup >= 15) && (age_at_signup <= 20)) {traineepot_ilr13_agegroup == 0} else {traineepot_ilr113_agegroup == 1} but im not getting anywhere im not to great at java ill be honest.

Thats cracking , thanks darius.

Please sign in to leave a comment.