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

Complicated Text box population

Community Beginner ,
Jan 03, 2019 Jan 03, 2019

Copy link to clipboard

Copied

Ok so I have a situation where I have Check boxes and text boxes that are related and need to populate together to a single text box  BUT I have another set of check boxes and text boxes that are related that ALSO need to populate together to the SAME single text box mentioned previously. So here are the separate java scripts for each set of data that I want to put into the same single text box. How do I join the scripts together? or is it possible?

Script 1:

var values = [];

for (var i=280; i<=281; 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("SLS EO").valueAsString!="") values.push("SLS EO: " + this.getField("SLS EO").valueAsString);

if (this.getField("SLS EC").valueAsString!="") values.push("SLS EC: " + this.getField("SLS EC").valueAsString);

event.value = values.join(", ");

Script 2:

var values = [];

for (var i=282; i<=283; 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("WS Time").valueAsString!="") values.push("WS Time: " + this.getField("WS Time").valueAsString);

event.value = values.join(", ");

ok so I need the info from check box 280 and 281 and text boxes "SLS EO" and "SLS EC" to be populate to the text box "Text 4" and the information to stay together/sequentially next to each other as they are related and then Check box 282 and 283 and text box "WS Time" to populate together/sequentially in the "Text 4".

so in the text box "Text 4" the info would be in this order

checkbox 280, checkbox 281, SLS EO, SLS EC, Checkbox 282, Checkbox 282, WS Time.

Does this make sense? Can anyone help me?

TOPICS
Acrobat SDK and JavaScript , Windows

Views

355

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
Community Expert ,
Jan 03, 2019 Jan 03, 2019

Copy link to clipboard

Copied

LATEST

Remove last line from script 1 and remove first line of script 2.

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