Expand my Community achievements bar.

PullDown population as a result of another PullDown value

Avatar

Former Community Member
Hi!



I'm very new in LiveCycle. I'm trying to select the values to be shown in a PullDown according to a selection in another one (the States names as a result of a Country selection, for instance).



Can I do it in an direct way? Can I do it in any way? Does anybody have a script to do so?



Formularies will be sent to remote recipients.



Thank you in advance.



Adobe Professional 7

Windows XP Professional

Notebook P4 3GHz/512Mb
2 Replies

Avatar

Former Community Member
Hi Gastón,



First of all, I've found the Adobe XML Form Object Model Reference a great help in these scripting questions. You can get it here:

http://partners.adobe.com/public/developer/en/xml/Adobe_XML_Form_Object_Model_Reference.pdf



What you're looking for is the addItem method. It's defined in the above document on page 581.



This isn't exact code, but just to give you an idea of where you need to go... let's say your country SOM-expression is xfa.form.Country and your state SOM-expression is xfa.form.State.



In the "exit" event on my xfa.form.Country field, I'd place an if-else statement.



if (xfa.form.Country == "United States") {

xfa.form.State.clearItems();

xfa.form.State.addItem("Alaska");

xfa.form.State.addItem("California");

}

else if (xfa.form.Country == "Mexico") {

xfa.form.State.clearItems();

xfa.form.State.addItem("Chihuahua");

xfa.form.State.addItem("Sonora");

}

else {}



Again, not tested code, but should give you a good idea of where to go.