Skip to main content
Participant
November 26, 2021
Question

Create drowpdown from filled in list

  • November 26, 2021
  • 1 reply
  • 315 views

Is it possible for one section of a fillable form to have lines for a list?

 

And then another section where that list is used to create a dropdown to rank the items from the list created above? Which would mean that the form filler would not need to re-type the information twice.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
November 26, 2021

Yes, it's possible, but requires using a custom-made script.

Participant
December 8, 2021
Hi!

How can I do that?
try67
Community Expert
Community Expert
December 9, 2021

It's a bit tricky. The list will have to be updated each time the text fields are edited, which will remove the user's current choice in it. So I would recommend you use a button to update the list, instead.

Let's say you have 4 text fields called Text1 to Text4 and the drop-down is called Dropdown1.

You can use the following code as the MouseUp event of said button field:

 

var items = [""];
for (var i=1; i<=4; i++) {
	var v = this.getField("Text"+i).valueAsString;
	if (v!="") items.push(v);
}
this.getField("Dropdown1").setItems(items);