1

I'm creating a web component used to select the name of a Belgian city. Basically, it's a simple input and when some text is entered in it, it display the list.

enter image description here

However, it must be possible to type the name of a city outside of Belgium. The issue is that, for internal reason, we don't and can't have a list of all city in the world, we only have the Belgian ones.

So the expectations are that a user must select a city if the desired city is in Belgium. So he can't just type "Braine l alleud" and get away with that, he really needs to select "Braine-l'Alleud" because the item is bound to some JavaScript instruction that select the city. But, if the desired city is outside of Belgium, then the user must be able to type something freely and get away with it.

So basically, I want the ensure to be force to select a city if it's in Belgium but be free to type a city name if it's outside of it.

  • 2
    can you clarify your question? – Mike M Apr 12 at 13:52
  • Welcome ssougnez to UXSE!! If you could give us a bit more clarity so the community can help you out more. For instance, you're asking that this allow for a city outside of Belgian. Is that also selectable? How does the information differ in terms of interaction and need on your end (the user). You're also stating that you can't display all cities in the world, then how are you limiting the feedback and why? – Majo0od Apr 12 at 14:06
  • That's weird... Half of my question has been posted...I'll complete it in the upcoming minutes. – ssougnez Apr 12 at 15:31
  • so, you can use type ahead if they enter a Belgian city, but the others require a separate call outside your database of cities, correct? – Mike M Apr 12 at 18:25
  • I've completed my question. Sorry, I had an issue with SE because he asked me to login and finally only post half of my question, pretty weird... However, I accepted the answer below as it's exactly what I needed ! – ssougnez Apr 12 at 19:37
2

If you can't deliver autopopulated results outside of Belgium, you can scope the search functionality, or be explicit in what's populating.

I hope I understand the question. This seems a matter of setting expectations.

One approach is to use a filter to start the search, where you have a dropdown showing Belgium vs. 'Anywhere' (I'm not sure of the best wording on this):

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.