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

Excel "IFS" statement equivalent in Forms

Community Beginner ,
Oct 02, 2025 Oct 02, 2025

This is what I'm trying to accomplish:

 

- CHOOSE ABC DEALERSHIP FROM DROP-DOWN LIST TO POPULATE TEXTBOXA

- TEXTBOXA HAS CALCULATION SCRIPT: var TETXBOXA =this.getField("DEALERSHIP").value;
event.value=TETXBOXA;

 

^^ this portion works great. Here is where I need assistance:

 

I NEED TEXTBOXB TO BE THE ADDRESS OF WHATEVER DEALERSHIP TEXTBOXA IS.

symone_1736_0-1759406818644.png

 

 

 

TOPICS
How to , PDF , PDF forms
58
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Oct 02, 2025 Oct 02, 2025
LATEST

You can use something like this as validate script of TEXTBOXA:

var dealers = {
  "Dealership1": "Address1",
  "Dealership2": "Address2",
  "Dealership3": "Address3",
  "Dealership4": "Address4",
  "Dealership5": "Address5"
};

var d = event.value;
if (dealers[d]) {
 this.getField("TEXTBOXB").value = dealers[d];} 
else {
 this.getField("TEXTBOXB").value = "";}

Be careful with field names, in your post you wrote TEXTBOXA but in your script is TETXBOXA.

View solution in original post

Translate
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 ,
Oct 02, 2025 Oct 02, 2025

Use a validation script at the dropdown for all text fields. 

Translate
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 ,
Oct 02, 2025 Oct 02, 2025
LATEST

You can use something like this as validate script of TEXTBOXA:

var dealers = {
  "Dealership1": "Address1",
  "Dealership2": "Address2",
  "Dealership3": "Address3",
  "Dealership4": "Address4",
  "Dealership5": "Address5"
};

var d = event.value;
if (dealers[d]) {
 this.getField("TEXTBOXB").value = dealers[d];} 
else {
 this.getField("TEXTBOXB").value = "";}

Be careful with field names, in your post you wrote TEXTBOXA but in your script is TETXBOXA.

Translate
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