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

If/Then statement for different boxes

Explorer ,
Jun 23, 2020 Jun 23, 2020

Copy link to clipboard

Copied

Basically, I have two text boxes. In one textbox, I want to make it so if someone rights a specific number, another number will appear in the other text box.

 

So in textbox 1, someone writes 30, the other box will automatically write down 45. And if they change it to 31, the other number will change to 63, so on and so forth. The problem is there is no way to do it with simple math, so I have to be able to choose which number corresponds to which number.

TOPICS
How to

Views

150

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 ,
Jun 24, 2020 Jun 24, 2020

Copy link to clipboard

Copied

LATEST

You can use something like this as the custom calculation script of the second field:

 

var s1 = this.getField("textbox 1").valueAsString;

if (s1=="30") event.value = "45";

else if (s1=="31") event.value = "63"; // etc.

else event.value = "";

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