Added Ability to display label instead of value #80

wants to merge 2 commits into


None yet

tareko commented May 14, 2012

Not all use cases involve the Value and Label being the same. This functionality makes it so that 'label' will be displayed, while 'value' will be submitted to the form.

Some if/then statements mean that if no Label is found, the Value is used - as before.

tareko commented May 17, 2012

A bug that I discovered is that the ID and not the label will be displayed if a person keys over to the appropriate entry.

Excellent feature !!

Doesn't appear to work when using the down key to select an autocomplete option. that.createTag(that._cleanedInput()); is called without the jquery ui item.

n3ISe commented Sep 20, 2012

It's ok when I use mouse to select the autocomplete option. But if I use the down key it will display ID instead of label.
How to solve this issue??

@n3ISe I've fixed that issue in my fork:

n3ISe commented Sep 20, 2012

Thanks @jjlharrison


You could create a branch with this and refactor later.

alaa9jo commented May 7, 2013

@n3ISe To fix the issue with key down you have to implement a function for autocomplete 'focus' property,like this:

autocomplete: {
focus: function (event, ui) {
                        return false;

Also,When tareko's changes are going to be merged into the master repository ?

+1. Would be really nice to add this feature.

If not ready for merge, what is missing? We may perhaps help? :)

Any update on this?

I was able to fix this issue by editing my jquery-ui.js file.

I am using jQuery UI version 1.10.4, it was on line 2267. I needed to change:

if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
     this._value( item.value );


if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
     this._value( item.label );

+1, started integrating this plugin but realized I can't use it in its current state.

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