Skip to main content
steft66579364
Known Participant
January 20, 2017
Answered

Poplulate fields from dropdown box

  • January 20, 2017
  • 1 reply
  • 558 views

I have a dropdown box with 3  possible answers and I want to populate other fields with data depending on the answers to the dropdown box.

So there are 3 possible  answers: and 3 possible data entries into fields.

Can someone give me a clue as how to start this script

This topic has been closed for replies.
Correct answer try67

You can use something like this as the drop-down's custom validation script:

if (event.value == "Option 1") {
     this.getField("Text1").value = "Some text";

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

     this.getField("Text3").value = "Doe";
} else if (event.value == "Option 2") {
     this.getField("Text1").value = "Some other text";

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

     this.getField("Text3").value = "Scott";

}

etc.

Edit: fixed an error in the code...

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
January 20, 2017

You can use something like this as the drop-down's custom validation script:

if (event.value == "Option 1") {
     this.getField("Text1").value = "Some text";

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

     this.getField("Text3").value = "Doe";
} else if (event.value == "Option 2") {
     this.getField("Text1").value = "Some other text";

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

     this.getField("Text3").value = "Scott";

}

etc.

Edit: fixed an error in the code...

steft66579364
Known Participant
January 23, 2017

Cheers try67,

Have sorted it out

Regards

Stef

Sent from Outlook<http://aka.ms/weboutlook>