These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Dynamic Dropdown content!!!

deepusrp
Registered: Jan 12 2009
Posts: 51
Answered

Hello All,

I am a newbee to this LiveCycle Designer. I'm using 8.0.1.

I have a question. Lets say I have a form in which i have to display English as well as French content based on a toggling radio button. I know that I can change the caption of the different elements in the form according to that radio button.

But can I change the content of a drop down element in the form based on the value of the radio button.

Silly Example:

There is a field called Term which should display Year 1, Year 2, Year 3 when radibutton is english
and it should display Année 1, Année 2, Année 3 when it is French.

This is just a silly example :)

If it is possible, a sample code snippet will help me a lot

Thanks in advance

Deepak

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
I think the best way doing this is to create a form with the same page twice, one in english, one in french.
One of them set to hidden, the otherone to visible.
Add two buttons to the master page for selecting the language.

With the buttons click event and some little JS you can show/hide the englisch or french page.

Form1.PageEng.presence = "hidden";
Form1.PageFre.presence = "visible";

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

deepusrp
Registered: Jan 12 2009
Posts: 51
Hello Radzmar,

Thanks for your reply... :)

Cant we set the values of a drop-down box dynamically.... It would be very bulky if i try to implement what you are suggesting, as there are many fields and many pages containing large date.

Deepak
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
LiveCycle Designer forms, i.e. the XFA format, is designed to handle language localization. There's a whole section of the format devoted to localized character sets. It's called the "localset" or "local". Look it up. So the functionality you need is built into the tool. However, I don't have a clue as to how it works. I suspect that one of the LiveCycle ES servers is needed to render the form in differnt languages.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

deepusrp
Registered: Jan 12 2009
Posts: 51
Can you provide any links or sample examples.

It would be of great help.

Deepak
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The key phrase in my previous post

thomp wrote:
However, I don't have a clue as to how it works.
So I can't help you there. I would suggest searching on the Acrobat developer site for "LiveCycle localization". Look in the LiveCyce specific areas.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

deepusrp
Registered: Jan 12 2009
Posts: 51
I have found one alternative way which is working fine for me... I think we can use this when we have less number of drop-down entries.

Answer:

at the click event of the radiobutton english (Javascript)

// Changing the captionForm.PAGE1.LocationInfo.Store.caption.value.text.value = "STORE NAME"; // Removing the items(French) from drop downfor (var i = Form.PAGE1.LocationInfo.Store.length; i >= 0; i-- ){Form.PAGE1.LocationInfo.Store.deleteItem(i);} // Adding new items(English) to drop down.Form.PAGE1.LocationInfo.Store.addItem("Store A");Form.PAGE1.LocationInfo.Store.addItem("Store B");Form.PAGE1.LocationInfo.Store.addItem("Store C");Form.PAGE1.LocationInfo.Store.addItem("Store D");

Same thing goes for French radiobutton click event but with french names.

Configure radiobutton with default English and display only english items in the beginning. Later when they select French, all the english names will be deleted and french items will be added.

I'll also try the method which thomp suggested...

Thanks
Deepak