This is a migrated thread and some comments may be shown as answers.

Select Top Item On Field Exit / Tab

3 Answers 46 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Seth
Top achievements
Rank 1
Seth asked on 26 Feb 2013, 06:23 PM
Is there a way to have the RadAutoCompleteBox select the top most item when the user tabs out of the field?  

3 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 01 Mar 2013, 08:31 AM
Hello Seth,

You can try the following code:
var originalHandler = Telerik.Web.UI.RadAutoCompleteBox.prototype._onBlur;
Telerik.Web.UI.RadAutoCompleteBox.prototype._onBlur = function(e) {
    if (!this._dropDown._shouldBlurAutoComplete) {
        return;
    }
             
    var item = this._dropDown.getItem(0);
             
    if (item) {
        this.get_inputElement().value = "";
        this._addEntryFromItem(item);
    }
             
    originalHandler.apply(this, [e]);
}

 

Kind regards,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jason
Top achievements
Rank 1
answered on 19 Jul 2013, 06:51 PM
Along these same lines, is it possible to select the highlighted item if a user tabs out of the AutoCompleteBox. For instance, if a user uses the arrow keys on the keyboard to select a different item and then hits the tab key?
0
Bozhidar
Telerik team
answered on 22 Jul 2013, 06:35 AM
Hello Jason,

This functionality has just been released and you can see it in action in our demos:
http://demos.telerik.com/aspnet-ajax/autocompletebox/examples/default/defaultcs.aspx

 

Regards,
Bozhidar
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
AutoCompleteBox
Asked by
Seth
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Jason
Top achievements
Rank 1
Share this question
or