How to populate a text filed from a single dropdown menu list

I Have a dropdown list and I want to populate a multiple line single text field. My dropdown is a list of names and I want to populate those name to a text field. When the user select one or ttwo names those names should appear in the text field .
Thanks for your help


Hosea Chua


1 Answer

First of all, a drop-down can only have one selected item.

The way you can do it is with a script, that should be placed as the custom validation script. The general structure of the script should be:

if (event.value=="John Smith") this.getField("Address").value = "John Smith\n1 Main Street\nSpringfield, Arizona"; // or whatever...
else if (event.value=="Jane Doe") this.getField("Address").value = "Jane Doe\n2 Main Street\nAustin, Texas"; // or whatever...
// etc.
else this.getField("Address").value = "";

.


Visit my custom-made PDF scripts website: http://try67.blogspot.com
Contact me personally: try6767@gmail.com


Gilad D (try67)   


Please specify a reason: