Copy link to clipboard
Copied
I've created a dropdown field with courses. Can I export two values to different fields in the same form? One is the price, the other is the maximum number of people allowed to attend.
Copy link to clipboard
Copied
Yes, you can, but it requires using a script.
Copy link to clipboard
Copied
Thanks. I've now duplicated the dropdown. So I have one with the courses and their export values as the price. The other is the courses and the maximum delegates allowed is the export value. The second dropdown will be hidden.
Do you know what the script would be?
The names of both dropdowns are "course" and "HiddenDropdown"
Copy link to clipboard
Copied
You don't need to do that. In fact, it just makes things more complicated.
One way of achieving this is to use a script as the custom validation script of the drop-down. You didn't provide any field names or actual values, so I'll just invent some:
if (event.value=="Option 1") {
this.getField("Price").value = 100;
this.getField("MaxAttendance").value = 20;
} else if (event.value=="Option 2") {
this.getField("Price").value = 120;
this.getField("MaxAttendance").value = 35;
} else if (event.value=="Option 3") {
this.getField("Price").value = 200;
this.getField("MaxAttendance").value = 50;
// etc.
} else {
this.getField("Price").value = "";
this.getField("MaxAttendance").value = "";
}
The only other thing to do is to make sure that the option to commit the selected value immediately under the dropdown's Properties - Options tab, is ticked.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now