TextBox AutoComplete

8 posts, 1 answers
  1. Will
    Will avatar
    30 posts
    Member since:
    Aug 2008

    Posted 12 Aug 2009 Link to this post

    We were using the Ajax Control Toolkit AutoComplete Extender, but it no longer displays properly with the .NET 3.5 release (May 2009), and it no longer has any cross-browser support.  So, we need an alternative that works exactly like the original did.  I looked at the info in the thread at:

    http://www.telerik.com/community/forums/aspnet-ajax/combobox/combobox-inside-grid-with-load-on-demand.aspx

    but the solution does not work like the original extender.  In fact it appears that it is not possible to get the ComboBox to work in this manor.  The primary purpose of the control is textual input, with the option to select suggestions from the dropdown to populate the text box (just like Bing and Google).  I tried to get the combo box to work in this manor, but the control constantly reverts control to the dropdown which makes it impossible to change the text in the text box.  Is it possible to get the ComboBox to work exactly like the old Ajax Control Toolkit AutoComplete Extender did?

    If not, is there an extender like this for the Input control?
  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 13 Aug 2009 Link to this post

    Hi Bill,

    I suggest you check this online demo. Is that what you are trying to achieve? Additionally you can check this demo as well which shows the different modes of autocomplete behavior.

    Regards,
    Atanas Korchev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Will
    Will avatar
    30 posts
    Member since:
    Aug 2008

    Posted 13 Aug 2009 Link to this post

    Hey Atanas,

    The first demo that you listed appears to be very similar and might work.  I've seen the second demo and it was what I was trying to use w/o any luck.  We are using it exactly like Bing and Google do for our search box.  I'll let you know if we run into any problems.

    Thanks,
    Bill
  4. Will
    Will avatar
    30 posts
    Member since:
    Aug 2008

    Posted 13 Aug 2009 Link to this post

    Hey Atanas,

    That worked out great.  I made the changes and it looks pretty good (http://www.beheard.com/).  There are a couple minor issues though.  Pressing ENTER from the ComboBox does not submit the page, which may be a bug in the javascript behind the control.  Also, when I allow the dropdown list to be collapsable by just specifiying a maximun height, it displays as a thin gray line when there aren't any items in the list.  I would think that the dropdown should be hidden when the list is empty.  The latter is just cosmetic, but the lack of a submit on ENTER may confuse people.

    Thanks,
    Bill
  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 14 Aug 2009 Link to this post

    Hi Bill,

    You can subscribe to the OnClientKeyPressing event of the RadComboBox and if the entered key is Enter (keyCode == 13) then submit the form:

    <telerik:RadComboBox ID="RadComboBox1" runat="server"  
        OnClientKeyPressing="(function(sender, e){ if (e.get_domEvent().keyCode == 13) document.form1.submit(); })" 
        AllowCustomText="true"


    All the best,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Eliza Sahoo
    Eliza Sahoo avatar
    29 posts
    Member since:
    Jan 2010

    Posted 01 Jun 2010 Link to this post

    The solution is to add autocomplete="off" attribute to textbox tag, which will help to stop auto suggestion behaviour for that particular textbox.
    And if you want to stop that behaviour for all the textboxes that are present inside a form then add autocomplete="off" attribute to form tag.
     
    According to HTML specifications, autocomplete is an unrecognized attribute which was originally created by Microsoft (feature of remembering what you have entered in previous text fields with the same name, available first in Internet Explorer) and has adopted by all other major modern browsers (except Opera).
  7. Peter
    Peter avatar
    1 posts
    Member since:
    Nov 2011

    Posted 16 Nov 2011 Link to this post

    In reply to second post (by Atanas Korchev).

    Thanks for the demos. First link I dont understand, its no autocomplete textbox. Second looks good. In my case I would like to get the list of elements from a web service and put that in a cache because it will only change at night time in batch job. How to set that up so that the data source will be the cache element?
  8. Cat Cheshire
    Cat Cheshire avatar
    128 posts
    Member since:
    Jun 2010

    Posted 16 Nov 2011 Link to this post

Back to Top