loop not working for check of duplicate values in a repeating table


i have form used marking down problem items, describing problems , assigning value specified item. in cases problems belong same class. when do, value associated problem should marked once. if problem in same class documented value should not recorded second time. have variable called based on switch statement in exit event of field records problem item number. script in variable supposed check duplicate values in table. if no other problem item in class selected, problem value should assigned number. if item same class has been entered, problem value should left blank. paste script variable below switch statement. when used call variable based upon change event problem item, script work. @ time, switch statement related drop-down menu. decided rid of drop-down , have used type item number. so, had move switch statement exit event field. when did this, script in variable no longer worked properly. here switch statment followed script in variable:

 

this.rawvalue = this.rawvalue.tolowercase();
var benabletextfield = true;
var = "inspection criteria: ";
var r = "required corrections: ";
switch (this.rawvalue)
{
  case "1a": // 1a- first debit option
    correctionstext.correctionlang = r+"correction description 1st debit";
    violcorrsection.violationstext.debitval = "c";
    violcorrsection.reference.reflanguage = i+"1st debit reference";
break;

  case "1b": // 1b- second debit option
    correctionstext.correctionlang = r+"correction description 2nd debit";
    violcorrsection.reference.reflanguage = i+"2nd debit reference";
    myscript.group1();
break; //the script continues various item numbers...

 

________________ variable script ________________________

 

function group1()
{
//used in checking duplication of violations
var ofields = xfa.resolvenodes("form1.mainbodysub.violationstablesubform.violationstable.violcorrsectio n[*].violationstext.itemno"); // looks resolve repeating rows
var nnodeslength = ofields.length; //assigns number of rows variable
var currentrow = xfa.resolvenode("form1.mainbodysub.violationstablesubform.violationstable.violcorrsection ").index;
var currentdebit = xfa.resolvenode("form1.mainbodysub.violationstablesubform.violationstable.violcorrsection [" + currentrow + "].violationstext.debitval");

for (var nnodecount = 0; nnodecount < nnodeslength; nnodecount++) // loops through item numbers looking duplicate violations
{
//console.println("nnodecount: " + nnodecount);
var nfld = xfa.resolvenode("form1.mainbodysub.violationstablesubform.violationstable.violcorrsection [" + nnodecount + "]");
//console.println("nfld.violationstext.itemno: " + nfld.violationstext.itemno.rawvalue);
     if (nfld.violationstext.itemno.rawvalue == "1a" || nfld.violationstext.itemno.rawvalue == "1b" || nfld.violationstext.itemno.rawvalue == "1c" || nfld.violationstext.itemno.rawvalue == "1d") // looks other 1s
     {
          currentdebit.rawvalue = "";
          nnodecount = nnodeslength;  // stop loop
     }
     else
     {
        currentdebit.rawvalue = "5";
     }
}

}

 

so, if enter 1b first time, should value of 5 appearing in debit value field. if enter 1c next, because belongs same group of class of problem items, there should no value assigned. happens values 1b , 1c don't appear @ because form thinks first 1b entry existed.

 

any ideas? have stripped down version of form can email reference if help. thanks

p.s. working livecycle designer es 8.2.1....

hi,

 

i can have @ form, can host somewhere acrobat.com or google docs , add link here.

 

regards

 

bruce



More discussions in LiveCycle Designer


adobe

Comments

Popular posts from this blog

Thread: "Broken" background image with Super Key

Thread: unable to set up wifi

Thread: Installing Mono with Winetricks *Help*