Agent (and other) picks

Some controlled vocabularies in Arctos (Agents, Taxonomy) are too extensive for drop-down menus, so a "pick" is used. Recent browsers sometimes interfere with the behind-the-scenes code used to control these picks. The following simplification will help you understand, and therefore hopefully self-debug, how these picks work.

First, a simple form that includes the pick function:

We type a name into the input box....

...and hit TAB (or otherwise leave the field, firing the JavaScript onChange event. This action opens a popup....

Clicking the desired entry populates the name and, normally behind the scenes, the ID field, and turns the Name field green:

This is a successful pick and will save properly.

However, on subsequent visits, your browser may try to be helpful and remember what you've previously typed into the name field:

Selecting one of these suggestions will not open a popup, will not lookup the ID (which is what's actually used to update the database), and will not turn the name field green:

We must somehow force the onChange event to occur if we are to get the information we need to successfully submit the form. The simplest way to do this is to backspace a character from the end of the suggested value and hit the TAB key to force the popup...

...resulting in a green Name field, an ID value, and a successful save.

Note that the popups will self-close if only one possible value is available. The popup opening and closing may be very quick - you may not even see it. However, successful popups will turn the name field green, and are likely to be quite noticeable on most computers.