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

Set focus on autocomplete control?

1 Answer 153 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Kjell asked on 11 Jun 2012, 11:43 PM
Seems like a dumb question but I can't figure out how to set focus.  I tried:

$("#controlName").data("kendoAutoComplete").input.focus();

the above works for a dropdown but not autocomplete, input appears to be undefined.  How do I manually set focus on a kendoAutoComplete?

1 Answer, 1 is accepted

Sort by
0
Accepted
Mark
Top achievements
Rank 1
answered on 30 Jun 2012, 05:43 PM
This is working for me:

<input  id="username"  data-role="autocomplete"  ..../>

$(document).ready(function () {  
       // snip
       $("#username").focus();
});

Tags
AutoComplete
Asked by
Kjell
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Share this question
or