Skip navigation
Currently Being Moderated

Value of empty fields in the barcode

May 17, 2011 2:57 AM

Hi

I use a custom script for my barcodes in a form with multiple instances and it works all right. There is just one little thing.

Empty field values get encoded to the barcode as ”null”. How do I change that to be just empty?

 

The script I use looks like this:

//{{Start Generated Content//
var is705ViewerRequired = false;
//End Generated Content}}//
 
function encodeBarcode() {
           var str = fieldName1.rawValue + "|" 
           + xfa.resolveNode("subform1[" + this.parent.index + "].fieldName2").rawValue + "|"
           + xfa.resolveNode("subform1[" + this.parent.index + "].fieldName3").rawValue + "|"
           return str;
}
function getInstanceData(node) {
           var str = "";
           var nNodeLength = node.length;
           for (nNodeCount=0; nNodeCount < nNodeLength; nNodeCount++) {
                      str += node.item(node).rawValue + "\n";
           }
           return str;
}
this.rawValue = encodeBarcode();

Kirstine

 

 

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points