Overview
Problem
You want to assign the value selected each time from a drop-down box to a text box and form a string with the values, as shown in the following figure.

Implementation Method
You can add an After Editing event for the drop-down box widget, allowing you to concatenate the value selected each time from the drop-down box with the existing text box content. For details about the API description, see API for Getting and Setting Cell Values.
Example
Template Design
Add a drop-down box widget and a text widget, as shown in the following figure.

Setting the Data Dictionary for the Drop-down Box Widget

Adding an After Editing Event to the Drop-down Box

The JavaScript code is as follows.
var value = this.getValue();
//Obtain the currently selected value.
var text = _g().getCellValue(0, 1, 1);
//Obtain the value of the cell where the text widget is located.
if (value.length != 0) {
//Exclude empty data.
if (text.length == 0) {
_g().setCellValue(0, 1, 1, value);
//If the text box contains no value, assign the currently selected value directly to the cell where the text box is located.
} else {
_g().setCellValue(0, 1, 1, text + "," + value);
//If the text box contains a value/values, append the current value to the existing one.
}
}Preview Effect
Save the template and click Data Entry Preview. The following figure shows the effect.

Note: Template Download
For details, you can download Assigning Multiple Values to a Text Box by JS.cpt.