auto complete multiple columns

Either using ajax, jquery for the auto complete function for the text box. Instead of shown e.g. 50 US states in one long columns.

How can it be coded with like 5 columns so the drop down list will be shortened.

I have / c#. Thanks,
Who is Participating?
Alexandre SimõesConnect With a Mentor Manager / Technology SpecialistCommented:
Ah... the comma issue is because I picked the multi-selection example from jQueryUI site.
See the updated sample code here:

Now, to get the data from the server.
For that you need to do an AJAX call to the server and get a JSON response.

You can see their example here:

The supported data source options are here:

Here's a sample code on how to implement the whole thing using
sivagnanam chandrakanthTechnical LeadCommented:
The div on which you are showing the ajax suggestions, wrap the text after certain lines for example 5 lines..

In other words,

Your Div should be styled to show the suggestions in multiple columns like this

Suggestion1     Suggestion4       Suggestion7
Suggestion2     Suggestion5       Suggestion8
Suggestion3     Suggestion6       Suggestion9
Alexandre SimõesManager / Technology SpecialistCommented:
Have a look at this example I built for you to see if it's what you need:

Basically I took a sample code from jQueryUI AutoComplete and just added a small CSS change:
.ui-menu-item {
    width: 33% !important;
    float: left;

Open in new window

Just run the example and let me know.

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Julian HansenCommented:
Just a comment on the last post - you might want to prefix the css change with a class or ID to keep the change local to the text box.

There might not be a side effect in this case but if you do have other situations where you don't want a multicolumn output then the above change will need to be localised to the text box in question.
solution1368Author Commented:
Great but I don't want to see comma after it is selected. Is it possible?
And if the data actually come from SQL db. How to do it in c#?

solution1368Author Commented:
alex: very helpful. I am glad to have your helps.
solution1368Author Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.