0

I have a question concerning a search fiel on my website. I want to let the user search for a city in germany. Currently i am using the 'odgbPLZnearby' i found online. This outputs other zip-codes within a given distance of the entered zip-code. Currently i use a to enter the zip-code.

Now i want to expand the feature so the user can also enter the name of the city or zip-code and city. I suppose i have to modify how the input is handled, but i do not know how.

How do i hanlde the different cases of:

  • zip-code only
  • city name only
  • zip-code + city
  • city + zip-code
  • one of them is entered incorrenctly
  • typos
  • city + zip-code dont match
  • added commas (e.g. "56068 Koblenz" / "56068, Koblenz")
  • different versions of citynames (e.g.: "Lauf a. d. Pegnitz" / "Lauf an der Pegnitz")

I would really appreciate your help. Thanks

Dee Ell
  • 21
  • 3
  • You can try and create you own code for this, i do not know if there are libraries that already solve this – Marco Mura Nov 18 '14 at 13:39
  • i pobably could write my own code if i know how to separate the zip-code from the cityname. Not sure how to handle a flexible user-input like that. – Dee Ell Nov 18 '14 at 13:53
  • you can put two input, one for zip and one for city. (with autocomplete maybe). And you can accept only numbers in the first one( i do not know how the german zip code is). – Marco Mura Nov 18 '14 at 13:55
  • German zip-code is numbers only. Splitting the input in two fields didnt test well, and users always put the wrong information in the fields. It is a good idea though, i'll pick it up. Got any tips on auto-correct? If it is somehow possible i would like to have it feel more like google-search in one input field than a very restricted form with several fields. ;) – Dee Ell Nov 18 '14 at 14:49
  • example 1 .> https://www.devbridge.com/sourcery/components/jquery-autocomplete/ , example 2 -> http://jqueryui.com/autocomplete/ – Marco Mura Nov 18 '14 at 14:50

0 Answers0