This example demonstrates how to obtain the current value of a drop-down list as well as the different ways to access the previous value of a drop-down list on a form. In addition to the actual scripts that set the current and previous values, it is important to note that the scripts are located on the change event for the drop-down list.
In the following example, when a form filler selects a value from the drop-down list, the selected value appears in the Current Value field. Then, when the form filler selects another value from the drop-down list, the new value appears in the Current Value List and the previous value appears in the Previous Value 1 field.
Livecycle eg get current previous values Getting the current or previous value of a drop down list
Note:
Each of the methods for obtaining the previous value of a drop-down list uses a different script. The Previous Value 1 text field is populated by a direct reference to the rawValue property of the drop-down list, whereas the Previous Value 2 text field is populated using the prevText property. For consistent results, it is recommended that you access the previous value by using the prevText property.
CurrentValue.rawValue = xfa.event.newText;
PreviousValue1.rawValue = DropDownList.rawValue;
PreviousValue2.rawValue = xfa.event.prevText;

Getting the current or previous value of a drop-down list