Hello Samuel ,
As far as I understand your question , you want to display the same value as the user selects from the dropdown lists in the textfield.If this is the case then the following script might help you . What you need to do is to capture the value which the user selects from the dropdown list .Then you have to assign the value to that particular textfield.Here you have to use change event as it helps when some changes has been made to the dropdownlist i.e. when the user selects some value from the dropdown list.
var newVal = this.boundItem(xfa.event.newText);
form1.page1.TextField1.rawValue = newVal;
Here recalculate is used because it Forces a specific set of scripts located on calculate events to execute. The specific events can be either pending calculate events or all calculate events. But I tested it without using recalculate , it works fine . However you should use recalculate.
Hope it helps.
thanks very much Bibhu_Nayak for your help ..really. But allow me to clarify the question..
Lets say I have a drop down list and a text field on a form
In the drop down list, I might have values such as Color1, Color2, Color3, Color4, and so on. where for example...
Color1 corresponds to blue,
Color2 corresponds to red,
Color3 corresponds to white,
Color4 corresponds to green
So if the user chooses Color1 from the drop down menu, the value "blue" should be automatically displayed in the text field
if the user chooses Color2 from the drop down menu, the value "red" should be automatically displayed in the text field
if the user chooses Color3 from the drop down menu, the value "white" should be automatically displayed ....etc.
I hope I'm really clear on what I'm trying to achieve. I need help with this.
yourTextField.rawValue = dropDown.getDisplayItem(dropDown.selectedIndex); // This populate whatever selected in the DDL
yourTextField.rawValue = dropDown.getSaveItem(dropDown.selectedIndex); // This populates the value of the selected DDL
Choose one of the option for your need.