ajax dropdown search

Posted on 2007-10-20
Last Modified: 2008-01-09
I want to create a search functionality wherein user types in a key and it shows a drop down with matching names. I dont want to use a webservice call or remoting.. How can this be achieved. can some examples be posted
Question by:dotnet0824
    LVL 16

    Expert Comment

    may I be so bold as to ask why you don't want to use webservices?

    So you want to have a purly client side auto complete box?

    WHy not just use a normal dropdown list? If you select the list and start typing you will find it will seek to the item matching the value you require.

    Author Comment

    but that needs a post back everytime u type in
    LVL 16

    Expert Comment

    what needs a postback?
    LVL 16

    Expert Comment

    View the code below in your browser to see the simple solution: -
    To test just select the text box and start typing.

    typing BBC will take you straight to the last item

        <option value="1">AAA</option>
        <option value="2">AAB</option>
        <option value="3">BAA</option>
        <option value="4">BBA</option>
        <option value="5">BBC</option>

    Author Comment

    Other than ajax speaking, for each and key press of keyword page needs to go back to the server
    LVL 16

    Accepted Solution

    but i've not offerd a solution that uses autoPostBack, all the modern browsers will automatically search through a list on keypress whenb using the select (DropDownList) control.

    If you are going to use a client side only solution why not just use a DropDownList?

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now