Skip to main content
Inspiring
December 18, 2024
Answered

export value

  • December 18, 2024
  • 1 reply
  • 419 views

Hi, I have 5 checkboxes named C1-C5 is it possible to show their export values in an alert when a button is pushed?

This topic has been closed for replies.
Correct answer Nesa Nurani

Yes, you can set export values using array, like this:

var eValues = ["A", "B", "C", "D", "E"];
for (var i=1; i<=5; i++) {
this.getField("C" + i).exportValues = [eValues[i - 1]];}

Change loop number to the number of fields you have and fill the array accordingly.

1 reply

Nesa Nurani
Community Expert
Community Expert
December 18, 2024

Use something like this:

var result = "";
for (var i=1; i<=5; i++) {
 var f = this.getField("C" + i);
 var exportValue = f.exportValues[0];
   result += "Field " + f.name + " export value = " + exportValue + "\n";}
app.alert(result, 3);
blazbAuthor
Inspiring
December 20, 2024

I have another question, since I will have a lot o checkboxes, is there an easier way to set export value to them instead of doing one at a time?

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
December 20, 2024

Yes, you can set export values using array, like this:

var eValues = ["A", "B", "C", "D", "E"];
for (var i=1; i<=5; i++) {
this.getField("C" + i).exportValues = [eValues[i - 1]];}

Change loop number to the number of fields you have and fill the array accordingly.