callback="plusone_vote"

Custom dropdown lists

Posted in: - Aug 02, 2011 3 Comments

This example shows how you can set up a standard dropdown list to allow searching and filtering of the items. The technique requires two small changes to the standard dropdown.

  1. Set the dropdown to allow custom text entry.
  2. Include a short script in the enter event of the dropdown, to open the list when the user clicks or tabs into it.

Here is an updated version that now includes another employee dropdown and a country dropdown, that will prevent a user from inputting a value that is not on the list.

Download: Assure Dynamics Custom dropdown list (Rev 2)

3 Responses to “Custom dropdown lists”

  1. Theodoros says:

    Dear Niall,
    about the searchableDDList is working perfect when you type uppercase
    but when you type lowercase does not work!

    Is it any solution?

    Thank you for your help

    • Niall O'Donovan says:

      Hi Theodoros,

      That part of the solution is not scripted at all. That is to say, if you take any dropdown list and allow custom text entry, as soon as the dropdown is opened the user can type to filter the items.

      This solution exploits this built-in behaviour, by forcing the list to open on the enter event. This way, as soon as the dropdown has focus, it is automatically opened for the user and then they can start to type. While it is not ideal, I would expect a user to learn that the filtering is case sensitive.

      Because the default behaviour of the dropdown object is to look for an exact match (case sensitive), I don’t think that it is going to be possible or straightforward to change this behaviour using additional script.

      You should have a look at Bruce’s solution over at Adobe’s Cookbooks: http://assure.ly/oYsTOm. This uses a textfield object and a listbox object to achieve the same result. However his solution is not case sensitive and can search for a match within the item string.

      Good luck,

      Niall

  2. Theodoros says:

    Thank you Niall

Leave a Reply

You must be logged in to post a comment.