Skip to main content
Participant
April 19, 2022
Question

How do I get a dropdown list to provide more information once the choice is selected from the list?

  • April 19, 2022
  • 1 reply
  • 595 views

I am working on creating a form for my company. One of the questions on the form is asking for them to select a location. How can I get each locations' Location Name, Address, Telephone # & Fax # to populate within the field once the Location Name is selected from the drop down?

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
April 19, 2022

As 'Validation' script of Dropdown field use something like this:

var f1 = this.getField("Location Name");
var f2 = this.getField("Address");
var f3 = this.getField("Telephone");
var f4 = this.getField("Fax");
switch(event.value){
case "Location1":
f1.value = "Location1 Name goes here";
f2.value = "Location1 address goes here";
f3.value = "Location1 telephone number goes here";
f4.value = "Location1 fax number goes here";
break;

case "Location2":
f1.value = "Location2 Name goes here";
f2.value = "Location2 address goes here";
f3.value = "Location2 telephone number goes here";
f4.value = "Location2 fax number goes here";
break;

default:
f1.value = "";
f2.value = "";
f3.value = "";
f4.value = "";}

 

Change field names to your actual field names and add more locations (before 'default' line) also  "Location1" and "Location2" are just examples, change those to your actual dropdown choices you have for locations.

In dropdown field properties, under options tab, check 'Commit selected value immediately'.

Participant
April 19, 2022

Where would I put this script? I have not used the Validation feature before.

 

I have found a way to put all of the information into the drop-down, but I would prefer to only show the Location Names in the drop-down instead of all of the information if that makes sense.

 

 

Bernd Alheit
Community Expert
Community Expert
April 20, 2022

Put it at validation of the dropdown field.