Copy link to clipboard
Copied
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
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...
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
Cheers try67,
Have sorted it out
Regards
Stef
Sent from Outlook<http://aka.ms/weboutlook>
Find more inspiration, events, and resources on the new Adobe Community
Explore Now