Expand my Community achievements bar.

SOLVED

Button to Hide Rows that are Shaded Green

Avatar

Level 9

In the form linked below, I am trying to create a custom button script (Javascript)  that will hide all rows that are currently  shaded green (border.fill.color.value = "204, 255, 204") in two dynamic tables. The rows are shaded when the user selects "Green" from a drop-down object located in each row.

Thanks for your help with this. 

https://acrobat.com/?d=hoXKsHVKALFdRwoS3Rnj7g

1 Accepted Solution

Avatar

Correct answer by
Level 8

Try this:

for (var a=0;a<LogoControls._ActionSubformA.count;a++){

for (var b=0;b<LogoControls.ActionSubformA.all.item(a).Table1._Row2.count;b++){

  if (LogoControls.ActionSubformA.all.item(a).Table1.Row2.all.item(b).Status.rawValue=="Green")

   LogoControls.ActionSubformA.all.item(a).Table1.Row2.all.item(b).presence="hidden";

}

}

for (var a=0;a<LogoControls._ActionSubformB.count;a++){

for (var b=0;b<LogoControls.ActionSubformB.all.item(a).Table2._Row2.count;b++){

  if (LogoControls.ActionSubformB.all.item(a).Table2.Row2.all.item(b).Status.rawValue=="Green")

   LogoControls.ActionSubformB.all.item(a).Table2.Row2.all.item(b).presence="hidden";

}

}

and for a show green button, just change "hidden" to "visible"

Kyle

View solution in original post

3 Replies

Avatar

Correct answer by
Level 8

Try this:

for (var a=0;a<LogoControls._ActionSubformA.count;a++){

for (var b=0;b<LogoControls.ActionSubformA.all.item(a).Table1._Row2.count;b++){

  if (LogoControls.ActionSubformA.all.item(a).Table1.Row2.all.item(b).Status.rawValue=="Green")

   LogoControls.ActionSubformA.all.item(a).Table1.Row2.all.item(b).presence="hidden";

}

}

for (var a=0;a<LogoControls._ActionSubformB.count;a++){

for (var b=0;b<LogoControls.ActionSubformB.all.item(a).Table2._Row2.count;b++){

  if (LogoControls.ActionSubformB.all.item(a).Table2.Row2.all.item(b).Status.rawValue=="Green")

   LogoControls.ActionSubformB.all.item(a).Table2.Row2.all.item(b).presence="hidden";

}

}

and for a show green button, just change "hidden" to "visible"

Kyle

Avatar

Level 9

dcidev,

Your script appears to work great. Thank you so much for your help with this form!

-Don