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

Hidden fields in drop down list

Avatar

Avatar
Give Back
Level 1
islandgirl23
Level 1

Likes

0 likes

Total Posts

59 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
View profile

Avatar
Give Back
Level 1
islandgirl23
Level 1

Likes

0 likes

Total Posts

59 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
View profile
islandgirl23
Level 1

17-08-2019

This is a followup question to my earlier post that was answered.  I wasn't sure if I could add to it, so I created another post.  Within my table, I have a couple of drop down names which DOES NOT require a serial number entry.  So, I want the serial number block to be hidden if I chose those entries but be visible when I chose a category that requires a serial number.  The top java script below works for one selection, so I entered that java script for each category separately thinking it would work for the other selections but then nothing works. Is there any way you can help?  The java script at the bottom that is in bold lettering is how I added the other categories.

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

  this.resolveNode("Row11.serialnumber").presence = "hidden";

} else { 

  this.resolveNode("Row11.serialnumber").presence = "visible"; 

}

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

  this.resolveNode("Row11.serialnumber").presence = "hidden";

} else { 

  this.resolveNode("Row11.serialnumber").presence = "visible"; 

}

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

  this.resolveNode("Row11.serialnumber").presence = "hidden";

} else { 

  this.resolveNode("Row11.serialnumber").presence = "visible"; 

}

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

  this.resolveNode("Row11.serialnumber").presence = "hidden";

} else { 

  this.resolveNode("Row11.serialnumber").presence = "visible"; 

}

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

18-08-2019

Hi,

Try something like this JavaScript in the change event of the "accessory type" drop down.

if (["Backpacks", "Briefcases", "Phone Cases"].indexOf($.boundItem(xfa.event.newText)) >= 0) {

  this.resolveNode("Row11").presence = "hidden";

} else { 

  this.resolveNode("Row11").presence = "visible"; 

}

Answers (5)

Answers (5)

Avatar

Avatar
Give Back
Level 1
islandgirl23
Level 1

Likes

0 likes

Total Posts

59 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
View profile

Avatar
Give Back
Level 1
islandgirl23
Level 1

Likes

0 likes

Total Posts

59 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
View profile
islandgirl23
Level 1

31-08-2019

Thank you.  That worked.

Avatar

Avatar
Give Back
Level 1
islandgirl23
Level 1

Likes

0 likes

Total Posts

59 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
View profile

Avatar
Give Back
Level 1
islandgirl23
Level 1

Likes

0 likes

Total Posts

59 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
View profile
islandgirl23
Level 1

18-08-2019

I uploaded the form with the script for you to see what I'm hoping to accomplish if that would help. Please choose accessories from the 'type" block.  You will see the table expand to include an "accessory type" block.  Notice that the serial number block is still present.  Now choose "Back packs" and you will see that the "serial number" block is hidden.  Now if you choose another category from the accessory type block, the "serial number" block reappears.  I need for this to happen for the other categories that do not have serial numbers such as Briefcases, etc.

equipment to send (1).pdf - Google Drive

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

17-08-2019

Hi,

I remember looking at this form last week now.

You can't make a cell within a table hidden, but don't you want to make the whole row hidden?

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

  this.resolveNode("Row11.serialnumber").presence = "hidden";

} else { 

  this.resolveNode("Row11.serialnumber").presence = "visible"; 

}

Or, you could change the rows to subforms as this isn't a table in the normal sense as and the table structure looks like it is just complicating things for you.

Bruce

Avatar

Avatar
Give Back
Level 1
islandgirl23
Level 1

Likes

0 likes

Total Posts

59 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
View profile

Avatar
Give Back
Level 1
islandgirl23
Level 1

Likes

0 likes

Total Posts

59 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
View profile
islandgirl23
Level 1

17-08-2019

Here is a screen shot.  Thank you.

1815424_pastedImage_0.png

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

17-08-2019

Hi,

You might need to include a screenshot of you forms hierarchy, but I don't think you would need the "Row11." part in the resolveNode reference, if Row11 repeats then there will be references like "Row11[0]","Row11[1]","Row11[2]", etc leaving off the index part as you have will always reference the first one, the same as "Row11[0]".

If the serialnumber object is a sibling of the dropdown you can just do this.resolveNode("serialnumber")

Regards

Bruce