Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search by text and value #800

Open
akaroot opened this issue Sep 5, 2012 · 15 comments
Open

Search by text and value #800

akaroot opened this issue Sep 5, 2012 · 15 comments

Comments

@akaroot
Copy link

akaroot commented Sep 5, 2012

Hi!
Please add capability to search in select lists not only by text but by value too.

For example,

  <select multiple class='chzn-select'>
                 <option value="some_value"> text one </ option>
                 <option value="other_value"> text 2 </ option>
                 ...
</ select>

And if I type "some" it should suggest me "text one".

@brockb
Copy link

brockb commented Sep 11, 2012

I would really love this functionality as well! I've got customer names in my select list with customer numbers as the option value. It would be very helpful to be able to search for a customer by either name or number!

@lSeldonl
Copy link

I do share your view. I have select with price like this

<option value="10000">10.000,00</ option>
If user typed 10000, he didn't find any value.

@rafasoares
Copy link

Also useful for states, like:

<option value="NY">New York</option>

@TheRightChoyce
Copy link

+1 having this as an option would be great.

@lyuehh
Copy link

lyuehh commented Jul 4, 2013

+1 for add this feature

@brockb
Copy link

brockb commented Aug 12, 2013

I'm finding myself in increasing situations where this would be extremely beneficial, especially if expanded even more.

For instance, with the customer dropdown list, if we could search text, value, AND data attributes... it would be awesome.

<select id="customer" class="chzn-select">
    <option value="27" data-company="The Price Is Right">Bob Barker</option>
    <option value="28" data-company="Wheel Of Fortune">Pat Sajak</option>
    <option value="29" data-company="Wheel Of Fortune">Vanna White</option>
    <option value="30" data-company="Jeopardy">Alex Trebek</option>
    <option value="31" data-company="Love Connection">Chuck Woolery</option>
</select>

Typing "Bob" in the search would bring up Bob Barker
Typing "30" in the search would being up Alex Trebek
Typing "Fortune" in the search would bring up both Pat Sajak and Vanna White

Sometimes our sales execs know the client by name (text), other times they know the client by client number (value), often times they can't remember the client's name or number but they know they work for a certain company, so it would be great to show a list of all clients who work for companyX when searching.

In the meantime, if you want this type of functionality, you have to put it all in the text of the option, which really clutters up some long lists and makes them difficult and ugly to view:

<select id="customer" class="chzn-select">
    <option value="27">Bob Barker - 27 - The Price Is Right</option>
    <option value="28">Pat Sajak - 28 - Wheel of Fortune</option>
    <option value="29">Vanna White - 29 - Wheel of Fortune</option>
    <option value="30">Alex Trebek - 30 - Jeopardy</option>
    <option value="31">Chuck Woolery - 31 - Love Connection</option>
</select>

Searching by text and value would be a huge improvement and I could see many people needing and using that capability. Searching by text, value AND data attributes would just be over the top amazingly useful.

@tjschuck
Copy link
Member

@brockb In the meantime, you could use optgroups to group people by company. Searching on them is supported:

@brockb
Copy link

brockb commented Aug 12, 2013

@tjschuck I could see that having some benefit. It might not work so well for those lists where there are hundreds of companies and thousands of contacts, but I could definitely see it being of benefit for smaller lists.

I can already see a few areas where I could implement that into existing applications.

For example... department users:
Engineering:
~ Joseph Brown
~ William Saunders
Customer Service:
~ Michelle Ritchey
~ Edward Alvarez
~ Earl Ward
Sales Support:
~ Dorthy Nelson
~ Andrea Crouse

Search for "Customer Service" and it narrows it down to Michelle, Edward and Earl. That will come in real handy in the meantime. Thanks for pointing that out to me! I'll definitely put that to use for some of my smaller lists.

I do hope we get value searching one of these days though. data-attribute searching may just be a pipe dream... but hey, one can dream, can't he? =)

@sang4lv
Copy link

sang4lv commented Jan 20, 2014

Quick question, is there any movement on this? +1 for this feature

@stephandesouza
Copy link

@brockb This is my need too, added #1660 to Coffee Script (#1923), and now started to work on a data-* solution.

@stephandesouza
Copy link

Done, made it real.

@joelworsham
Copy link

So what's the status on this? I would love to search by option value as well.

@9IPHP
Copy link

9IPHP commented Apr 25, 2016

Is this feature done?

@pfiller pfiller mentioned this issue Jun 7, 2016
@pfiller
Copy link
Contributor

pfiller commented Jun 7, 2016

#628 is worth looking at, maybe. Would add value, but would be helpful.

@ecrofeg
Copy link

ecrofeg commented Mar 16, 2017

Going on with this one #2796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests