Expand my Community achievements bar.

Question about Drop-Down List

Avatar

Former Community Member

Hi, I have a question.

I inputted three fruits in drop-down list. Apple, Orange, Banana.

dropdownlist.JPG

I want use object - binding - specify item values like this.

dropdownlist2.JPG

I want to show the value(Jerry or Danny or Julia) in the Textfield when I select Apple in change event of drop-down list.

This is the code.

code.JPG

TextField1.rawValue = this.rawValue;

But when I select Apple, in the Textfield, there is previous value in Text-box.

When I select Apple, 'null' is appeared in Textfield.

result1.JPG

When I select Orange, 'Jerry' is appeared in Textfield.

result2.JPG

Please let me know how I can do.

Thanks.

Jaeho.

11 Replies

Avatar

Level 5

Hi,

If you change your code to use

TextField1.rawValue = xfa.event.newText;

then this should work as expected.

hope this helps

Malcolm

Avatar

Level 4

Hello Jaeho,

You write the same code i.e.

TextField1.rawValue = this.rawValue;

in exit event, so that it will work as your requirement.

Thanks,

Debadas.

Avatar

Former Community Member

Thanks, Malcolm.

But That was not the result which I expected.

If you have any other solution, please let me know.

Thanks again for your help.

Jaeho

Avatar

Former Community Member

Hi, Debadas.

Thank you for your help.

But I had used the code you said and there was a small problem.

So I want to know the solution not in the exit event but in the change event.

If you know the solution, please let me know.

Thanks again, Debadas.

Jaeho.

Avatar

Level 5

Hi,

How about this code ( placed in the change event of the drop down list).

TextField1.rawValue = this.boundItem ( xfa.event.newText)

Hope this helps

Malcolm

Avatar

Former Community Member

Hi.

Wow, your code is exactly correct.

Can I ask you something? How did you know?

you have book about this or?

If you don't want to reply, it doesn't matter.

Thank you for your help.

Avatar

Level 6

Jaeho,

One reason why your code didn't work, originally, is probably because you were using JavaScript (JS) scripting while in FormCalc (FC) language. I figured you were attempting to script in JS because of the usage of the .rawValue suffix (which isn't necessary in FC). Using .rawValue in FC will still work; however, using the " ; " character at the end of your JS script while in FC, will actually prevent the script from working.

So had you changed the language to JS and kept the same code and moved it to the Exit event (like the other person recommended), the script would have worked. Or you could have left in FC language and wroet the script as such: TextField1 =  $ (placed on Exit event on Drop-down object).

See correct image below:

image1.jpg

image2.jpg

If you notice in your image, the red underlined area says FormCalc.

Shaun

Avatar

Level 6

PS. Two good resources are:

1. PDF Forms, Using Acrobat and LiveCycle Designer Bible by Ted Padova, Angie Okamoto (ISBN: 978-0-470-40017-3)

2. Creating Dynamic Forms with Adobe LiveCycle Designer, by J.P. Terry  (ISBN13: 978-0-321-50987-1)

Regards,

Shuan

Avatar

Level 5

Hi,

Most of it is experience ( about 15 years working with Acrobat and various products)

A few good resources ( like the ones posted )

This is a good resouce http://forms.stefcameron.com/ ( although he has now moved on to pastures new, but there is still a lot of good stuff there)

The livecycle and Acrobat help manuals ( they take a bit of getting used to but once you can find things they do have their uses)

And this forum of course ( if the search works )

Best Regards

Malcolm

Avatar

Former Community Member

Hi, Malcolm.

Thanks for your advice.

I want to appreciate you about your help.

Best Regards

Jaeho

Avatar

Former Community Member

Hi, Shuan

I already have the book you recommended, Adobe Live Cycle Designer by J.P. Terry.

Your advice helps me a lot

Anyway thank you again, buddy.

Best Regards

Jaeho.