These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Icon Switching

prodeditor
Registered: Feb 10 2011
Posts: 3

function replaceIcon()
{
var w = this.getField("wIcon").buttonGetIcon();
var r = this.getField("rIcon").buttonGetIcon();
 
for(var x=0; x
for (var i=0; i 
myArray is an array of field names (A1, A2, A3, A4, B1, B2, B3, B4, C1, C2 ..... ) corresponding to buttons (A1, A2, A3 ....)
 
myArrayTwo is an array of values (A1, B1, C3, D4, E5 ... )
 
I want the button icon to display one icon if the values match, another icon if they don't. If I comment out the else, the if/mtach buttons (buttonSetIcon(w)) display but not the else (buttonSetIcon(r)) buttons. If I don't comment out the else part, all the buttons are set to buttonSetIcon(r).
 
I can't get this to work like a typical if/else value assignment.
    

My Product Information:
Acrobat Pro 10.0, Macintosh
prodeditor
Registered: Feb 10 2011
Posts: 3
sorry, the whole ting is like this:

function replaceIcon()
{
var w = this.getField("wIcon").buttonGetIcon();
var r = this.getField("rIcon").buttonGetIcon();

for(var x=0; x
prodeditor
Registered: Feb 10 2011
Posts: 3
sorry, the whole ting is like this:

function replaceIcon()
{
var w = this.getField("wIcon").buttonGetIcon();
var r = this.getField("rIcon").buttonGetIcon();

for(var x=0; x
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Try posting the entire code.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

maxwyss
Registered: Jul 25 2006
Posts: 255
looks as if the forum software is braindamaged, not being able to see the difference between a HTML tag and a less than operator…

try67
Expert
Registered: Oct 30 2008
Posts: 2398
It usually works just fine. Are you placing the code inside any kind of tag?

Test:

for(var x=0; x<100; x++)Edit:

Seems to work fine for me...

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com