CB: How to check the 'city' field against the chosen 'country' field

4 years 10 months ago #312386 by erichburkhard
In my CB community the user is requested to set the 'country' field (where he lives - I have implemented this via a country list).... Besides this the 'city of residence' field is also mandatory ....The problem: At the moment it is possible to choose e.g. 'Switzerland' as a country and 'Peking' as the corresponding city.....which makes no sense.

At the moment I have absolutely no idea how to implement this check:
a) is there a certain API (to 3rd party providers as e.g. Google & co who provide such 'city lists'?
b) may be it is easier to install a 3rd party extensions to fullfill this requirement?

If option b) is chosen the requirements are as follows:
- I think the extension has to be CB compliant
- the chosen city (value) has to be stored in the corresponding cb (city) field
- as an option it could be useful if the location (= the chosen city) is stored in a way that radius search can be implemented later

Until now I have browsed through many extensions on the market which fullfill the above requirements but also do many useless things. I have completely lost the overview. So I wanted to ask if there is a certain recommendation how to proceed: a) or b) ...and if b) is chosen: Is there a certain stable & nice CB compliant extension you could recommend (free of charge or as paid download)

regards

Please Log in to join the conversation.

4 years 10 months ago #312388 by krileon
You can use Query Select fields provided by CB Query Field and the Update On provided by CB Core Fields Ajax to chain country > state > city fields together. See the below tutorial on how to do this.

www.joomlapolis.com/documentation/345-cb-query-field/tutorials/18533-configuring-dynamic-usa-state-city-zip-fields-with-cb-query-field-plugin

See the below for creating the initial Country dropdown.

www.joomlapolis.com/documentation/345-cb-query-field/tutorials/18377-configuring-a-country-field-with-cb-query-field-plugin

Note the sample state, city, zip data we provide is for USA only. You'll need to source data from elsewhere or just display a text field for them to supply city and zip. As for searching we do not provide a means of radius searching.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.191 seconds

Facebook Twitter LinkedIn