Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

change entered value, even if there are no matches #83

Open
dmmz opened this issue Apr 29, 2013 · 0 comments
Open

change entered value, even if there are no matches #83

dmmz opened this issue Apr 29, 2013 · 0 comments

Comments

@dmmz
Copy link

dmmz commented Apr 29, 2013

I needed some values to be transformed directly, even though there is no matching element. i.e: to make uppercase. To solve that implement the toUpperCase in a 'beforeUseConverter' function, and I just added 'setValue' to 'beforeUseConverter' on the source code

$.Autocompleter.prototype.beforeUseConverter = function(s, a, b) {
s = this.getValue();
var converter = this.options.beforeUseConverter;
if ($.isFunction(converter)) {
s = converter(s, a, b);
}
this.setValue(s); //added setValue
return s;
};

But maybe there would be nice to have a 'transformAfterUse' option or something like that

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

No branches or pull requests

1 participant