Do you want the value of the selected option in the dropdown or its label?
To copy the value of the selected option, do this:
Code: Select all$("#mydropdown").setOnchange( function (newVal, oldVal) {
$("#mytextbox").setValue(newVal);
});
If you need the label of the selected option, then do this:
Code: Select all$("#mydropdown").setOnchange( function (newVal, oldVal) {
var aOptions = $("#mydropdown").getInfo().options;
for (var i in aOptions) {
if (aOptions[i].value == newVal) {
$("#mytextbox").setValue(aOptions[i].label);
break;
}
}
});
Where "mydropdown" is the ID of your dropdown and "mytextbox" is the ID of your textbox.
Import this DynaForm for an example:
(2.31 KiB) Downloaded 688 times