0

I am building a profile to collect a list of states for various countries a person holds a license in. The states/countries I'm looking for are not associated with any particular address type so I'm not seeing just the states for the selected country like you do normally. It becomes very cumbersome to sort through ALL the states for ALL the countries! Is there a way to tie the state and country fields together?

1

If I understand your question correctly, I may have just posted an answer to a similar question I had. Hope it helps you.

https://civicrm.stackexchange.com/a/18093/2169

In summary, it's to use the civicrm_buildForm hook in order to tie your country and state fields together. That will cause the states' list to be refreshed when you choose a country.

0

Pick the country first. I know with a standard address country is last if at all. Put it first then it should limit the list to the states appropriate to that country.

  • That is how it works when the state and country fields are linked by the same address type (home, work...). But I'm creating custom data fields where I want to tie the state and country fields together. – Karen S Mar 10 '17 at 22:25

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.