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

How do I assign different text to a floating field based on a drop down list selection?

Avatar

Avatar
Validate 1
Level 1
DZW
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
DZW
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

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

06-06-2019

I am attempting to insert different text options into a floating field based on a number selected in another drop down list - how do I accomplish this?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

18-06-2019

You might want to put the code on the Change event of your dropdown list. And also you need to set the Binding of the dropdown list to "Specify Item Values" on the Binding tab of the Object palette - then each of your list items will be assigned a number for use in the script.

In the script you can add a separate "case" statement for each choice in the dropdown list - the case number corresponding to the value of the selection.

var selection = this.boundItem(xfa.event.newText);

switch (selection) {   case "1": // Selection 1    TextField1.rawValue = "item1";
    break;   case "2": // Selection 2     TextField1.rawValue = "item2"     break; } 

In the script above you'll have to change "TextField1" to the name of the text box, you want the text to show up in.

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 1
DZW
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
DZW
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

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

06-06-2019

PDF

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

06-06-2019

Is it an Adaptive form or a PDF form?