filla2003
filla2003

Reputation: 734

Yii autocomplete matches from beginnig of the word

I'm using the CJuiAutoComplete widget for autocomplete user entries inside a form. Therefore I have a list with some cities. Is it possible to show only values, where the entry matches from the beginnig of the word?

An example: When typing "ha" inside the field I get

But I need something like this: - Hagen - Hannover - Halle - ...

Is this possible?

Upvotes: 0

Views: 85

Answers (2)

marooned
marooned

Reputation: 51

Another thing to do could be to increase the minimum requirement to 3 or more characters. That way you will get fewer entries, and closer to what you require. This is obviously a hack, but should improve things a fair bit.

Upvotes: 1

Burhan Çetin
Burhan Çetin

Reputation: 676

Here is my answer for auto complete question in that link. You can edit the query with using "like"...

how to create custom autocomplete textfield in yii

Upvotes: 0

Related Questions