Modifying activeDropDownList to point to next selection even if exact input not in database

Currently when the user types a character (or multiple characters) into the form element of an activeDropDownList (populated by listData & findAll), the activeDropDownList advances to the first matching record. If there is no matching record, nothing happens.

I would like to modify the way user input works so that even if there is no exact match found in the database for the characters the user types, the selection advances to next alphanumeric choice rather than remaining unchanged. In addition, if the user types a character beyond the last item in the drop down list, I’d like the selection to move to the last alphanumeric choice in the list box.

I am the newest of newbies and I have no idea where to find the code in the framework that controls how an active list box responds to user input.

Can anyone help? Thanks!

Behavoir of DropdownLists (a.k.a. select boxes) is controlled by your browser. If you want to change that behaviour, you need to do so with javascript/jquery. Yii doesn’t include such js, but you can create a custom widget with this feature anytime.

Might be a little tough for newbies, though. So you have to learn some jquery first - which will not hurt your Yii experience anyway. Check out Events (keypress/keyup/…) and how to prevent default actions with javascript. Or try a google search, maybe someone has created something similar.