Premium forums

Set focus on autocomplete control?

  • Kjell
    Kjell avatar

    11 Jun 2012 (Link to this post)

    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?
  • Answered Mark
    Mark avatar

    30 Jun 2012 (Link to this post)

    This is working for me:

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

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

Read FAQ or see Kendo UI in action!

Launch Demos