Custom Keystroke Scripting Issue
I essentially have two scripts that work in unison on a PDF form, namely a custom keystroke script associated with a combo drop-down box and a document level function 'setFieldValues' invoked by the script (both provided below). The issue I am experiencing is that the scripts appear to perform without issue if the script for the combo box is placed in the 'on blur' event (a poor choice at best for obvious reasons) but fail to perform as anticipated if I were to place the script associated with the combo box as a custom keystroke script with the addition of the line 'if(event.willCommit)... in which case I receive 'undefines' (refer to screen shot) for all the form fields intended to be assigned values by the scripts. One thing I noticed is that if I were to replace the index variable 'i' with a digit from 1-14, the form fields miraculously receive the values associated therewith regardless of the selection made in the combo box which is understood. This leads me to believe that for whatever reason, the index variable 'i' is not being recognized when using the custom keystroke script. Why this is, I haven't the slightest idea. Any thoughts or suggestions as to why are most appreciated. Thank you ahead of time. Scroll down to see scripts below.
/* Custom Keystroke Script (Note: 'if(event.willCommit) was intentionally removed when the script was placed and invoked from the 'on blur' event */
if(event.willCommit){
if(event.value == "Select|Lookup Name")
resetForm(["inf"]);
else
setFieldValues();
}
//setFieldValues() function
function setFieldValues(){
var i = event.target.currentValueIndices;
for(j=1;j<15;j++){
f=getField("inf."+j);
f.value=aVendors[i][j];
}
}


Screen shots attached for reference
