• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Help custom calculation

Community Beginner ,
Dec 26, 2018 Dec 26, 2018

Copy link to clipboard

Copied

Ok, I have Javascript below that populates multiple checkbox values and multiple text box values into 1 single text box on a different page BUT the values of the text boxes are numbers and when they populate to the single text box there is no way of telling what the number value pertains to.  so for example: If I type into "Temp" textbox "96"....I want "Temp - 96" to populate to the single textbox. Is this possible with this script? if not, please help!

var values = []; 

for (var i=500; i<=505; i++) { 

    var fname = "CheckBox "+i; 

    var f = this.getField(fname); 

    if (f==null) { 

console.println("Error! Can't find: " + fname); 

        continue; 

    } 

    if (f.valueAsString!="Off") values.push(f.valueAsString); 

}

if (this.getField("Vision Findings").valueAsString!="") values.push(this.getField("Vision Findings").valueAsString);

if (this.getField("Temp").valueAsString!="") values.push(this.getField("Temp").valueAsString);

if (this.getField("BPright").valueAsString!="") values.push(this.getField("BPright").valueAsString);

if (this.getField("BPleft").valueAsString!="") values.push(this.getField("BPleft").valueAsString);

if (this.getField("Oxi").valueAsString!="") values.push(this.getField("Oxi").valueAsString);

if (this.getField("Pulse").valueAsString!="") values.push(this.getField("Pulse").valueAsString);

if (this.getField("Resp").valueAsString!="") values.push(this.getField("Resp").valueAsString);

if (this.getField("Chest Exp").valueAsString!="") values.push(this.getField("Chest Exp").valueAsString);

  1. event.value = values.join(", ");
TOPICS
Acrobat SDK and JavaScript , Windows

Views

328

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
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 27, 2018 Dec 27, 2018

Sure. Change this line, for example:

values.push(this.getField("Temp").valueAsString);

To:

values.push("Temp: " + this.getField("Temp").valueAsString);

Votes

Translate

Translate
Community Expert ,
Dec 27, 2018 Dec 27, 2018

Copy link to clipboard

Copied

LATEST

Sure. Change this line, for example:

values.push(this.getField("Temp").valueAsString);

To:

values.push("Temp: " + this.getField("Temp").valueAsString);

Votes

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
community guidelines