Expand my Community achievements bar.

dynamic tool tip

Avatar

Level 3

Hi guys

I'm wondering if it is possible to have the tool tip for a dropdown box based on the entries in the drop down box.

so if the user could select "a", "b", or "c" from the drop down box, the tool tip would read "a / b / c"

I could of course type it out manually, but I have several dozen and a universal script would be much quicker.

Thank you

3 Replies

Avatar

Level 10

Hi,

Adobe have an excellent guide to "Calculations and Scripts", it goes back to v6 but is still applicable today. I can't find it on the Adobe web site so I will upload it.

It covers a lot of visual feedback script and is grouped by object type which is very handy. The information is probably available elsewhere, like the help file (but sometimes you need to know what you are looking for; in order to find it).

Anyway something like this in the exit event:

var vAnswer = this rawValue;

switch(vAnswer)

{

     case "a":

     DropDownList1.assist.toolTip = "You have selected A";

     break;

     case "b":

     DropDownList1.assist.toolTip = "You have selected B";   

     break;

     case "c":

     DropDownList1.assist.toolTip = "You have selected C";   

     break;

     default:

     DropDownList1.assist.toolTip = "Please select between a, b, or c";   

     break;

}

Hope that helps,

Niall

Avatar

Level 3

thank you for the help

that's not quite what i had in mind.

the tool tip itself is static, it does not depend on the user's input, and the script will be the same for each of the drop down boxes.

The idea is to have the script access the choices in the choice list, and generate a tool tip based on them.

so as i said, the tool tip could be simply entered by myself, but it would be cumbersome. I am merely looking for a shortcut here.

Any thoughts?

Thank you

Avatar

Level 10

Hi,

2nd attempt to post this!!

I am sure it can be done; but not sure of exactly how.....

It should be possible to access the items in the dropdown and place them in a temporary variable / array. You would then concat these into the tooltip at initialize stage. To be honest if the items in the dropdown list are not going to change at run time, I would be inclined to type in the tool tip at design stage. I am not sure if I can help you on this one...

Steve Walker did have a posting to this forum, dealing with dynamically populating dropdowns. I am sure that his script object will hold some useful approaches to solve your problem. Search for "stooge".

Sorry I could not be of more help. Good luck,

Niall