Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
How to display data to multiple text box field (more than 100) based on combo box selection in PDF by using JavaScript

I have declared my arrays in a combo box and wants to show the data to different textbox based on combo box selection. Tried the most time consuming method and the sample below. It is working perfectly fine.

VAR fruits = ['Item | Apple | 10.0',]; //declared array 
var Textbox_0 = this.getField("Textbox_0").value; 
var combobox1 = this.getField("combobox1").value;
 if (combobox1 == "fruits") { this.getField("Textbox_0").value = fruits[0]} else { this.getField("Textbox_0").value = "Nothing"}

My questions are. 1.Is there any way to use 1 text box and change to multiline to show all the data. Instead of creating multiple text fields? OR 2.Is there any way to define the range of textbox fields to display the data. Instead of defining one by one? example fill the data from Textbox 1 to 100 3.How to use the for loop for this? Tried with for loop but it is displaying only the last value of the array not all of them? Please help on this issue!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

After some research and testing I found an easy way to do this.

  1. Create individual text box and change the option to multiline. 2.Declare the variables. 3.Use the .map function for this.

var example= ["3333-Test11-8888-9090909"];

var Text1 = this.getField("Text1").value;

var Text2 = this.getField("Text2").value;

var combo1 = this.getField("combo1").value;

var number = example.map( (e,i) => (i+1)).join('\n');

var number1 = example.map(exampl => exampl.split('-')[0]).join('\n');

var number2 = example.map(exampl => exampl.split('-')[1]).join('\n')

if (combo1 == "xxxx") {

this.getField("Text1").value = (number1);

this.getField("Text2").value = (number2);

} else { this.getField("Text1").value = "Something";

this.getField("Text2").value = "Something";

}

This way PDF boxes can be limited.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!