Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Autocomplete - selecting an item not on the list

$
0
0
Re: Autocomplete - selecting an item not on the list
Web Connection 5.0
Re: Autocomplete - selecting an item not on the list
04/28/2012
05:03:50 PM
3HN10KO4E Show this entire thread in new window
Gratar Image based on email address
From:
Rick Strahl
To:
Attachments:
None
Hi Geoff,

Typical auto-complete behavior that is used in most other applications is:


  • type
  • Selection pops up
  • Press tab to accept selection
  • Press ESC to use text you've typed and close autocomplete

This is the stock behavior of the jQuery-ui control that this control wraps. If you want different behavior you can override the control client side events that handle selection.

To do that you need to use the event that fires when the value is changed (exposed via OnClientSelection on the control). The default behavior for auto-complete (as per the jquery-ui base control that is used for this) is to select from the list. In that method you can look at the typed input, the last key pressed (on the evt) and decide what you want to do. You can make that a reusable function that you load into a script referenced on all pages.

But - I wouldn't recommend this. The standard behavior is pretty common and used on other sites so I would stick with the behavior that people see in other apps and mobile devices...

+++ Rick ---



I've played with the Autocomplete control a bit. It has one slightly annoying behaviour.

If the user puts in "123", and AutoComplete offers "123A" or "123B" as options, there is no way for the user to, using the keyboard, leave the text field and have the value remain as "123". Maybe this is the way Autocomplete is supposed to work, but it's not the way I want it to work. I'd like the user to have the option to use his input or select an item from the Autocomplete list.

A workaround is to add an item at the top of the cursor that mirrors the user input--but it's a bit clunky.

Is there some way that the user can enter a value in the text field that is not on the Autocomplete list, once that list has popped up? The ideal would be a property that would allow the text box to be a non-selected value.

.. Geoff




Rick Strahl
West Wind Technologies

Making waves on the Web

from Maui, Hawaii

Viewing all articles
Browse latest Browse all 10393

Trending Articles