This is what I have so far... It does not seems to be the best way if you have 25-50 fields to filter and collect. //set the vars var one = this.getField("A1"); var two = this.getField("A2"); var three = this.getField("A3"); var four = this.getField("A4"); var five = this.getField("Results"); //this function concatenates the fields values into one with a return as a separator. function concatFields(field1,field2,field3,field4,fieldDest){ //ensure all vars are present if(field1 && field2 && field3 && field4 && fieldDest){ var fieldVals = new Array(); if(field1.value!='' && field1.value!=null){ fieldVals.push(field1.userName); } if(field2.value!='' && field2.value!=null){ fieldVals.push(field2.userName); } if(field3.value!='' && field3.value!=null){ fieldVals.push(field3.userName); } if(field4.value!='' && field4.value!=null){ fieldVals.push(field4.userName); } fieldDestResult = fieldVals.join('\n'); //only populate the fieldDest if it's empty //if(fieldDestResult.value!=''||fieldDestResult.value!=null){ fieldDest.value=fieldDestResult; //} } } concatFields(one,two,three,four,five);
... View more