CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • cities field autocpmplete field
Pages: [1]

Author Topic: cities field autocpmplete field  (Read 1168 times)

sushil

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Art of Living
  • CiviCRM version: 3.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.2
cities field autocpmplete field
June 07, 2009, 11:28:16 am
How can I add an autocomplete field for cites? I have a database with more than 70K cities.
The cities should be filtered by a select state field.

Thank You

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: cities field autocpmplete field
June 07, 2009, 07:58:06 pm

You might want to model this similar to the country -> state jquery widget (chain selector). I suspect you'll need to make changes to the code base and the templates. Contact us on IRC if you need help/assistance

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

sushil

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Art of Living
  • CiviCRM version: 3.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.2
Re: cities field autocpmplete field
June 07, 2009, 08:26:20 pm
I'm using 2.3 civicrm and I looked in the 2.3 sandbox as well, and I could not find this country-> state widget in the UI. Which functionality has this widget please?

Thank You

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: cities field autocpmplete field
June 08, 2009, 04:32:09 pm
New Individual form is one example (selecting Country then populates the corresponding state/province values).
Protect your investment in CiviCRM by  becoming a Member!

sushil

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Art of Living
  • CiviCRM version: 3.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.2
Re: cities field autocpmplete field
June 09, 2009, 10:44:52 am
Thank You. I have looked at that model, and I don;t think will work, due to the fact that a state can have hundreds of cities which cannot show up in select dropdown. Is ther another alternative like an autocomplete field?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: cities field autocpmplete field
June 09, 2009, 10:47:54 am
Check the "New Relationship" form. The autocomplete widget for the Target Contact is filtered based on the contact type specified in the selected relationship type (so I think this is a similar pattern to selecting State and then having that value filter the available cities).
Protect your investment in CiviCRM by  becoming a Member!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: cities field autocpmplete field
June 09, 2009, 12:10:16 pm
Maybe Xavier's blog will give you some ideas

http://civicrm.org/node/528
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • cities field autocpmplete field

This forum was archived on 2017-11-26.