1. peterpetrov
  2. General
  3. Thursday, February 25 2016, 05:27 PM
Hello, i need to set countries and towns and i was wondering if i can make such reference on registration/profile so i can get something like "country_name", "country_id" and to reference the town names as "town_name", "country_id". How can i do that?
admin Accepted Answer
Admin
Hi,
sorry this is not possible, there is no interaction between fields to filter values.

But this could be a great feature, so in next release we will try to improve "Select" field type to do this, now "Select" field type allow to get options from DB, we could add some thing to filter these options based from another field value.
  1. more than a month ago
  2. General
  3. # 1
admin Accepted Answer
Admin
Hi,
good news, in the next release we will add this new feature (experimental), see video :D

We will add to new parameters, to filter DB options from another field value:
1) Field to retrieve value to filter
2) Column on table where will be applied this filter

This is very useful feature, i.e. Category -> Article or Country -> State -> City

My example (countries, states, cities):

I have installed on DB the countries, states and cities from https://github.com/hiiamrohit/Countries-States-Cities-database

Attachments (3)
  1. more than a month ago
  2. General
  3. # 2
peterpetrov Accepted Answer
Hey, i just checked my profile here. That is great. Thanks for the feature. I was just discussing a new website with my better half and we are going to benefit from many of the easy profile items. I find it is the best user component for Joomla ever!!!
  1. more than a month ago
  2. General
  3. # 3
dlh Accepted Answer
Hi,
How can I do to put the correct state fields when I select a country ?
  1. more than a month ago
  2. General
  3. # 4
admin Accepted Answer
Admin
Hi,
I suppose you have a tables structure like this:
Table Countries "countries":
country_id (ID of the country)
country_name (Name of the country)

Table States "states"
state_id (ID of the state)
state_name (Name of the state)
country_id (ID of the country associated)

So you need to create 2 select fields, Country and States, and fill options like screenshots.
Attachments (2)
  1. more than a month ago
  2. General
  3. # 5
dlh Accepted Answer
Thanks and how can I do to display the field only when the parent field i validate (as your video) ?
  1. more than a month ago
  2. General
  3. # 6
admin Accepted Answer
Admin
Hi,
you can do this with conditions, so in the field "Country" you can set a condition like: if not equal to custom value (empty) then show field "State"
Attachments (1)
  1. more than a month ago
  2. General
  3. # 7
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.