Copy link to clipboard
Copied
I can't work this one out.
See image... I have 100 fields that i need a script on a button to enter a random number from 1 to 20 in them. The red button already clears them.
Any advice?
Copy link to clipboard
Copied
What are those fields called?
Copy link to clipboard
Copied
currently Tex01 to Tex100, but can be whatever is easiest
Copy link to clipboard
Copied
You can use this code:
for (var i=1; i<=100; i++) {
var n = Math.floor(Math.random()*21)+1;
if (n==22) n--;
if (i<10) this.getField("Tex0"+i).value = n;
else this.getField("Tex"+i).value = n;
}
Copy link to clipboard
Copied
You rock, ty!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more