Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Creating a ListBox on "change" event

Avatar

Former Community Member
I am using Designer 7 and the Script Editor and wish to create a list box when a "change" event occurs. Is this possible?
10 Replies

Avatar

Former Community Member
If you are talking about creating the contents of another listbox based on the change event of the previous listbox, then have a look at the samples folder. Specifically -

Multiple Dropdownlists
or

Multiple dropdownlist allow users to make 3 different choices from a list of options

Avatar

Former Community Member
David



Basically when I type in a text field, based on what I type, I need some way of presenting some context sensitive help to the user. A list box may not be what I need. A dialog box perhaps?



When I click on an item in the box, the box should disappear and hopefully the selected value appears in the text field.



I have tried the app.popUpMenuEx method but the popup box is modal so input to the field is stopped until the box is cleared. I need to carry on typing and ignore the box if I wish.

Avatar

Former Community Member
I see what you mean, something like an autocomplete prompt. Not sure a custom prompt can be done which is non-modal. Maybe with Dynamic PDF in version 7, you could create a list box as a popup field, handle the events through scripting and hide it once the user selects or navigates away from the field. I have never tried this before, so might not work. It would be a bit difficult to maintain.

Avatar

Former Community Member
Hmmm, now you've really confused me :-). I thought it might be difficult.

What I've just been playing around with is having a hidden list box becoming visible on change and invisible when necessary. Thing is when I set the presence property to invisible the box remains visible. I'm using



MyList.presence = "invisible";



Running the form in Acrobat and PDF Preview gives the same result.

Avatar

Former Community Member
Sorry, Didn't mean to confuse you. Sounds like you need to change the type to Dynamic PDF. If you have it set to Static or compatibile mode, you will get the behaviour you are seeing.



I also tried the hidden list box and it did hide initially and then display when you type a character. I can also select a value and have it populate the text field. Only problem is when you type the initial character and make the listbox visible, you are leaving the field and returning to it in one go, which means the character becomes selected. You would want to have the cursor after the character.

Avatar

Former Community Member
I am following this post and I think it is interesting so I come up with the example for others in case they have the same question.



The example can be found
here

Avatar

Former Community Member
Does anyone have this example anymore? I'm looking for a way to make an autocomplete prompt for a textbox.

Avatar

Former Community Member
Can you be more specific by what you mean by "an autocomplete prompt for a textbox"? Thanks.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
For instance, I have a large list of items that go into a list box. I want the user to be able to type into a text box and while they are typing, the list box is displayed with possible suggestions for what it thinks are typing. The user can either keep typing or arrow down to one of the choices. Right now I have a textbox and a hidden listbox. This listbox displays with the possible choices when the user is typing in the textbox. If they click one of the choices it will display in the textbox, but I would like them to be able to scroll down to the listbox from the textbox.



Here is an example: http://www.google.com/webhp?complete=1&hl=en



Any help would be greatly appreciated. Thanks.

Avatar

Former Community Member
Ah, so if I understand correctly, you're big question is how you can get so that the user can arrow down from the text field into the list box. Unfortunately, I don't know how you could capture the arrow key click in order to set the focus down to the list box.



Chris

Adobe Enterprise Developer Support