Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

populate a drop down list from another drop down list

Avatar

Avatar
Validate 1
Level 1
jess_us
Level 1

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
jess_us
Level 1

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
jess_us
Level 1

18-03-2018

I have 2 dropboxes. Dropbox 1 is a list of names. Dropbox 2 is a list of numbers, each number corresponds to a name in dropbox 1

Dropbox1 - Names

     - Bill

     - John

     - Roberta

Dropbox2 - numbers

     - 0000 (Bill's number)

     - 1111 (Roberta's number)

     - 2222 (John's number)

Is it possible to select a name in Dropbox 1 and have the corresponding number for each name show in dropbox 2?

Thank you in advance for any help and input!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

19-03-2018

Simple.

Two combos, one has names, one has numbers

1446361_pastedImage_0.png1446374_pastedImage_1.png

In the change event (javascript) for DropDownList1 put:

if ($.boundItem(xfa.event.newText) == "Bill") {
  this.resolveNode("DropDownList2").rawValue = "0000";
}

else if ($.boundItem(xfa.event.newText) == "John") {
  this.resolveNode("DropDownList2").rawValue = "1111";
}

else if ($.boundItem(xfa.event.newText) == "Roberta") {
  this.resolveNode("DropDownList2").rawValue = "2222";
}

NOTE: Unless you make your second combo readonly, you will be able to select a different number regardless of what is selected in the first.

Answers (4)

Answers (4)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

20-03-2018

Glad to help

Avatar

Avatar
Validate 1
Level 1
jess_us
Level 1

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
jess_us
Level 1

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
jess_us
Level 1

20-03-2018

Thank you for your answer MinusZero.

Very helpful!

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

19-03-2018

Sure thing, a switch can be used too.

You could alternatively use this javascript in DropDownList1's change event:

switch($.boundItem(xfa.event.newText))

{

case "Bill":

this.resolveNode("DropDownList2").rawValue = "0000";

break;

case "John":

this.resolveNode("DropDownList2").rawValue = "1111";

break;

case "Roberta":

this.resolveNode("DropDownList2").rawValue = "2222";

break;

default:

break;

}

Avatar

Avatar
Validate 1
Level 1
ScottDM
Level 1

Likes

0 likes

Total Posts

22 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
ScottDM
Level 1

Likes

0 likes

Total Posts

22 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Affirm 1
View profile
ScottDM
Level 1

19-03-2018

Nice; I'm going to bookmark this one.

I'm guessing the Case statement would be helpful here too.