How to calculate sum of filled fields?


hi there!

my question how can calculate sum of filled fields?

for example in pdf document have fields need filled name , surname , @ end of document field represents total of "name , surname" fields shows how many persons in document. operation shouldn't take in account blank/unfilled fields.

now know simple "sum(+)" calculation i'd have enter "1" each of field , i'd avoid that.

that's not sum, more of total.  require using custom-made script.
are names of fields consistent (like name1, name2, name3, etc.), or list of unrelated fields?

if latter can use script custom calculation script of text field want total appear:

 

var fields = ["first name", "last name"]; // etc. var total = 0; (var in fields) {     if (this.getfield(fields[i]).valueasstring!="") total++; } event.value = total; 


More discussions in JavaScript


adobe

Comments

Popular posts from this blog

Illustrator CS6 Ocurrío un error E/S en el archivo.

Why is os_ViewContainer running?

Animate - problem with duplicating scripts after loop