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

All instances of object in master page

Avatar

Avatar
Validate 100
Level 3
DKinsley
Level 3

Likes

9 likes

Total Posts

545 posts

Correct Reply

5 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 3
DKinsley
Level 3

Likes

9 likes

Total Posts

545 posts

Correct Reply

5 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
DKinsley
Level 3

16-08-2016

I have a Text Field object at the top of my master page. When the user selects from a drop down object, the Text Field's background color needs to change from white to either green, yellow or red. I created the script in the change event of the drop down and it works correctly until a second page is dynamically created as a result of text the user added to other fields. How do I select all instances of the Text Field?

Here's my script:

Form1.Subform4.Table2.Row1.Overall[0]::change - (JavaScript, client)

if ($.boundItem(xfa.event.newText) == "Green") {

  xfa.resolveNode("#pageSet.Page1.OverallTop").border.fill.color.value = "204, 255, 204";//green color

}

if ($.boundItem(xfa.event.newText) == "Red") {

  xfa.resolveNode("#pageSet.Page1.OverallTop").border.fill.color.value = "204, 255, 204";//red color

}

if ($.boundItem(xfa.event.newText) == "Yellow") {

  xfa.resolveNode("#pageSet.Page1.OverallTop").border.fill.color.value = "255, 255, 0";//yellow color

}

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Applaud 5
Level 1
alassir
Level 1

Likes

0 likes

Total Posts

17 posts

Correct Reply

2 solutions
Top badges earned
Applaud 5
Affirm 1
View profile

Avatar
Applaud 5
Level 1
alassir
Level 1

Likes

0 likes

Total Posts

17 posts

Correct Reply

2 solutions
Top badges earned
Applaud 5
Affirm 1
View profile
alassir
Level 1

17-08-2016

Hi DKinsley ,

I have had a similar Problem, and solved it this way:

You need to amend the JavaScript code in that way, that you change every instance on every masterpage, where the item is inherited.

In you case the code should look probably like this:

Form1.Subform4.Table2.Row1.Overall[0]::change - (JavaScript, client) 

  • if ($.boundItem(xfa.event.newText) == "Green") { 
  •   xfa.resolveNode("pageSet.NameofMasterpage[0].OverallTop").border.fill.color.value = "204, 255, 204";//green color 
  • if ($.boundItem(xfa.event.newText) == "Red") { 
  •   xfa.resolveNode("#pageSet.NameofMasterpage[1].OverallTop").border.fill.color.value = "204, 255, 204";//red color  --> this is the same color as above
  • if ($.boundItem(xfa.event.newText) == "Yellow") { 
  •   xfa.resolveNode("#pageSet.NameofMasterpage[2].OverallTop").border.fill.color.value = "255, 255, 0";//yellow color 

I'm not that good in coding, so perhaps the code still needs to get running, but I hope it Points you to the right direction.

Best

Dietmar

Answers (1)

Answers (1)

Avatar

Avatar
Validate 100
Level 3
DKinsley
Level 3

Likes

9 likes

Total Posts

545 posts

Correct Reply

5 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 3
DKinsley
Level 3

Likes

9 likes

Total Posts

545 posts

Correct Reply

5 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
DKinsley
Level 3

17-08-2016

Thank you!