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

Drop-Down with pictures

fuchsd
Registered: Nov 18 2010
Posts: 11
Answered

Hello Ladies and Gentleman's,
 
I'm one of the new, fresh people to this so accept my apology for naivety.
 
I want to create a form as a project status sheet. Among others I need a drop-down list where I can choose between green, yellow and red Circles. I have 'heard' that this might be done with implementing a Java script, but till now I am not familiar with this.
 
Any support is much appreciated.
Thanks
Regards
Daniel

My Product Information:
LiveCycle Designer, Windows
fuchsd
Registered: Nov 18 2010
Posts: 11
Hello,
I can also life with a solution, where I have shapes defined. I was working in the direction of xml, where I can use include for example:

But to be honest, I don't not on how to make this acite in LiveCycle Designer

Regards
Daniel
joflo723
Registered: Nov 1 2010
Posts: 8
Accepted Answer
Someone on the Adobe Forums once posted this. Wish I could remember who to give credit to. But you might be able to adapt it to work for you.

https://acrobat.com/#d=4zaCGN3e7-v6oNA-dwspVg

Jo

Edit: Just found that it was Niall O'Donovan (one of my LiveCycle heroes) that posted that script above.
fuchsd
Registered: Nov 18 2010
Posts: 11
Thanks you very much Jo, that looks also pretty promising, but I can not make it work. What I did:
- Use Adobe Pro Extended and create a new combo box, with three letters
- Go to properties of the field
- Go to Action tab
- Set Select Trigger to: Mouse Exit and Select Action to: Run a JavaScript
I thought that is, what I should have done, but the objects to not change the color. Do you have a hint for me, what I need to consider?
Thanks
Daniel
joflo723
Registered: Nov 1 2010
Posts: 8
I'm new at this too, but I tried making each value a lowercase l in the Wingding 3 font (which is the circle), and I think the problem is that since all of the letters (wingdings) are the same (same value), it's assigning the same case (the first case) to all three of them. I think if you wanted to go with this technique, you'd have to use three different letters.

I tried using the 1, 2, and 3 in a circle wingdings (from the Wingdings 2 set), and added a text box that becomes visible when you enter the field and invisible when you exit, with instructions to select 1 for Green, 2 for Yellow, and 3 for Red.

https://acrobat.com/#d=OpnR6NabhP8boGtJ-I*HUw

Would this be something you could use (at least until someone comes up with a better solution)?
fuchsd
Registered: Nov 18 2010
Posts: 11
Hello Jo,
I think the solution is great, but I would need a hint on how to place the code. If when I go to the LifeCycle Designer, could you give me three(?) steps on how to enter this with the condition on 'apply when exit'.
Thanks for your patience.
Daniel
joflo723
Registered: Nov 1 2010
Posts: 8
Well, the code is written in the objects themselves, so if you just copy the objects from my form and paste them onto your form, I think they should work. Try that and see.

If not, you just have to make the little textbox with directions invisible, then put this code as javascript in the Enter event of the dropdown list:

TextField1.presence = "visible";

And this code as javascript in the Exit event of the dropdown list:

switch (this.rawValue)
{
case "1":
this.font.fill.color.value = "0,255,0";
break;

case "2":
this.font.fill.color.value = "255,255,0";
break;

case "3":
this.font.fill.color.value = "255,0,0";
break;
}

TextField1.presence = "invisible";

Jo


fuchsd
Registered: Nov 18 2010
Posts: 11
thanks Jo, I will need to look into this tomorrow - different time zone. Thanks for the support, I should be able to do this now with your support.
Regards
Daniel
joflo723
Registered: Nov 1 2010
Posts: 8
I was thinking about this over the weekend, and was thinking maybe something like this would be closer to what you're trying to do:

https://acrobat.com/#d=MaY5OxkqRN*-rpOjWiUJmg

This simply stacks three images on top of each other, all OVER the value in the dropdown list, and depending on the selection, makes the appropriate image visible.

Jo
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
The code is JavaScript and not FormCalc.

Also the images are created from selecting the "Wingdings" font, so you really do not have true pictures but one of characters within the font. The background color for the field is changed by the code. You must also have a unique text value for each selection item to be able to make a selection, so you will not be able to have a circle glyph for each item.

George Kaiser

fuchsd
Registered: Nov 18 2010
Posts: 11
Hello Jo,
unfortunately I have problems to take advantage of your solution. What I have done:

1. Images
- uploaded 3 images,
- made them invisible
- renamed in the hierachie accroding to your sample file to red, yellow, green
2. Created the drop down box with three pull down options and activated 'specify item values'
3. Copied your code (Java) to the exit action of the drop down option

Now nothing is happening, once I change the pull down option. Do you have a hint on what is missing? Did you may somewhere added some variables?
Thanks for your support and patience.
Daniel
fuchsd
Registered: Nov 18 2010
Posts: 11
double save
joflo723
Registered: Nov 1 2010
Posts: 8
Nope, no variables and that is the only script in the form.

Did you save the form as a Dynamic XML form? It will not work on a Static PDF.

Jo
fuchsd
Registered: Nov 18 2010
Posts: 11
Jo, that is what I was missing - I hope I can help you or anyone in the forum with the same patience in the future as you did.
Daniel