One Field shows results if other fields have been used.

New Here ,
Oct 19, 2017

Copy link to clipboard

Copied

I have a field (Field1) that gets information from a calulated field (Field2) fed by three other section group fields (fieldgroupTotal-1,fieldgroup total-2, fieldgroup Total-3). Everthing works well.  I want field 1 to only show something once all THREE fieldgroup totals have a number.

var v = this.getField("Total_Score").valueAsString;  if (v=="") event.value = "";

else {

    var score = Number(v);

    if (score>=3 && score<=7) event.value = "Low";

    else if (score>=8 && score<=12) event.value = "Medium";

    else if (score>=13 && score<=15) event.value = "High";

    else if (score<=0) event.value = "Not Started";

}

This Script works great, I just now need it to only work if all three groups have had an enterie inside of that group selected.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

38

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

One Field shows results if other fields have been used.

New Here ,
Oct 19, 2017

Copy link to clipboard

Copied

I have a field (Field1) that gets information from a calulated field (Field2) fed by three other section group fields (fieldgroupTotal-1,fieldgroup total-2, fieldgroup Total-3). Everthing works well.  I want field 1 to only show something once all THREE fieldgroup totals have a number.

var v = this.getField("Total_Score").valueAsString;  if (v=="") event.value = "";

else {

    var score = Number(v);

    if (score>=3 && score<=7) event.value = "Low";

    else if (score>=8 && score<=12) event.value = "Medium";

    else if (score>=13 && score<=15) event.value = "High";

    else if (score<=0) event.value = "Not Started";

}

This Script works great, I just now need it to only work if all three groups have had an enterie inside of that group selected.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

39

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 19, 2017 0

Have something to add?

Join the conversation