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

Set fields to NA in array field loop

rabdullah
Registered: Jul 7 2009
Posts: 14

Hello I have been struggling with a small problem for a few days. I have a group of fields. listed as tl.1 tl.2 etc

I needed to go have a test field where when i entered input in numeric between 1 -10 the fields TL1 - TL10 will either stay blank or be filled with NA

example if I entered 2 in my field the remaining fields 3 -10 will all be filled with NA

I have gotten this far but I am fallinjg short somewhere any assistance will be valuable

function fieldLoop()
{
var e= event;
var myArray = new Array ("c5cmProximal","c1cmProximal", "c2cmwithin","c4cmwithin","c6cmwithin","c8cmwithin","c10cmwithin","c18cmwithin","c20cmwithin","c1cmdistal","c5cmdistal");
var dropDownValue = e.target.value;

for (i=1;i<=10;i++) {
for (y in myArray) {
var myfield1 = myArray[y] + "edvTL." + i;
var myfield2 = myArray[y] + "psvTL." + i;
if (i >= dropDownValue ) {
myfield1.target.value = "NA";
myfield1.hidden = true;
myfield1.borderColor = color.red;
app.alert(myfield1 + " is a field that will be read only set with a value NA. Value will be read only");
// e.value.y = "NA";
}
}
}

}

My Product Information:
Acrobat Pro 9.0, Windows
rabdullah
Registered: Jul 7 2009
Posts: 14
function fieldLoop()
{
var e= event;
var myArray = new Array ("c5cmProximal","c1cmProximal", "c2cmwithin","c4cmwithin","c6cmwithin","c8cmwithin","c10cmwithin","c18cmwithin","c20cmwithin");
var dropDownValue = e.value;

for (i=1;i<=10;i++) {
for (y in myArray) {
var myfield1 = myArray[y] + "edvTL." + i;
var myfield2 = myArray[y] + "psvTL." + i;
if (i != dropDownValue ) {
app.alert(myfield1 + " is a field that will be read only. Value will be read only and set to NA");
e.value.myfield1 = "NA";
}
}
}}