Is there a way of populating the profile_values table in the drupal DB before opening your site to the public?
I want the auto-complete to work and provide cities which I have already put into the database. At the moment, they only include cities that existing members have already entered.
Also, is there a way of providing extra information in the dropdown like you get on answers.com? If someone types "San Fr" I would like something similar to "San Francisco (California)" to appear. Is that possible?
Neil
The best you can do with profile module is to add "selection" field type and input your list right there.
HTH .s
Neil: esl-lounge.com wrote:
Is there a way of populating the profile_values table in the drupal DB before opening your site to the public?
I want the auto-complete to work and provide cities which I have already put into the database. At the moment, they only include cities that existing members have already entered.
Also, is there a way of providing extra information in the dropdown like you get on answers.com? If someone types "San Fr" I would like something similar to "San Francisco (California)" to appear. Is that possible?
Neil
No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.7/712 - Release Date: 3/6/2007 3:42 PM
Thanks for your response.
Unfortunately, I have a selection of 23,000 towns so that is not practical. Isn't there a way of getting the autocomplete to "look" in a different table for values?
N
----- Original Message ----- From: "sime" info@urbits.com To: support@drupal.org Sent: Wednesday, March 07, 2007 12:45 PM Subject: Re: [support] More effective use of auto-complete in Profile
The best you can do with profile module is to add "selection" field type and input your list right there.
HTH .s
Neil: esl-lounge.com wrote:
Is there a way of populating the profile_values table in the drupal DB before opening your site to the public?
I want the auto-complete to work and provide cities which I have already put into the database. At the moment, they only include cities that existing members have already entered.
Also, is there a way of providing extra information in the dropdown like you get on answers.com? If someone types "San Fr" I would like something similar to "San Francisco (California)" to appear. Is that possible?
Neil
No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.7/712 - Release Date: 3/6/2007 3:42 PM
-- [ Drupal support list | http://lists.drupal.org/ ]
Hi,
Neil: esl-lounge.com wrote:
Thanks for your response.
Unfortunately, I have a selection of 23,000 towns so that is not practical. Isn't there a way of getting the autocomplete to "look" in a different table for values?
Yes this is possible by altering the form using the hook_form_alter() and tell it use a different path to find the autocomplete.
Gordon.
N
----- Original Message ----- From: "sime" info@urbits.com To: support@drupal.org Sent: Wednesday, March 07, 2007 12:45 PM Subject: Re: [support] More effective use of auto-complete in Profile
The best you can do with profile module is to add "selection" field type and input your list right there.
HTH .s
Neil: esl-lounge.com wrote:
Is there a way of populating the profile_values table in the drupal DB before opening your site to the public?
I want the auto-complete to work and provide cities which I have already put into the database. At the moment, they only include cities that existing members have already entered.
Also, is there a way of providing extra information in the dropdown like you get on answers.com? If someone types "San Fr" I would like something similar to "San Francisco (California)" to appear. Is that possible?
Neil
No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.7/712 - Release Date: 3/6/2007 3:42 PM
-- [ Drupal support list | http://lists.drupal.org/ ]
Thanks Gordon,
would it thus be possible to use the hook_form_alter() to get the autocomplete to look in say location_towns BUT the value ultimately selected by the user is entered into the normal profile_values table? Just want to ensure I've understood that correctly.
Scenario:
User A goes to fill out profile "City" field. Types "Sa..." and the following values appear:
San Antonio, Texas San Francisco, California (both present in our pre-populated location_towns table)
User selects San Antonio, Texas but only the value "San Antonio" gets entered into the profile_values table. Is that possible?
Neil
----- Original Message ----- From: "Gordon Heydon" gordon@heydon.com.au To: support@drupal.org Cc: info@urbits.com Sent: Wednesday, March 07, 2007 1:29 PM Subject: Re: [support] More effective use of auto-complete in Profile
Hi,
Neil: esl-lounge.com wrote:
Thanks for your response.
Unfortunately, I have a selection of 23,000 towns so that is not practical. Isn't there a way of getting the autocomplete to "look" in a different table for values?
Yes this is possible by altering the form using the hook_form_alter() and tell it use a different path to find the autocomplete.
Gordon.
N
----- Original Message ----- From: "sime" info@urbits.com To: support@drupal.org Sent: Wednesday, March 07, 2007 12:45 PM Subject: Re: [support] More effective use of auto-complete in Profile
The best you can do with profile module is to add "selection" field type and input your list right there.
HTH .s
Neil: esl-lounge.com wrote:
Is there a way of populating the profile_values table in the drupal DB before opening your site to the public?
I want the auto-complete to work and provide cities which I have already put into the database. At the moment, they only include cities that existing members have already entered.
Also, is there a way of providing extra information in the dropdown like you get on answers.com? If someone types "San Fr" I would like something similar to "San Francisco (California)" to appear. Is that possible?
Neil
No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.7/712 - Release Date: 3/6/2007 3:42 PM
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
On Wednesday March 7 2007 4:42 am, Neil: esl-lounge.com wrote:
Thanks Gordon,
would it thus be possible to use the hook_form_alter() to get the autocomplete to look in say location_towns BUT the value ultimately selected by the user is entered into the normal profile_values table? Just want to ensure I've understood that correctly.
Scenario:
User A goes to fill out profile "City" field. Types "Sa..." and the following values appear:
San Antonio, Texas San Francisco, California (both present in our pre-populated location_towns table)
User selects San Antonio, Texas but only the value "San Antonio" gets entered into the profile_values table. Is that possible?
Neil
The short answer is yes.
The medium answer is that you probably also want to use hook_user() to help with this. In hook_form_alter(), query your database for the cities and states and use the results to fill your select field's #options array, using the city table's id as the array's key.
Then in hook_user, probably on the submit op, take the key for the item the user selected, do another database query on the city table and store that value in the profile field.
There are actually a couple of different ways you could go about this, depending on what you ultimately wanted to do. This should at least get you going in the right direction, and you can work out your details as you come to them.
http://api.drupal.org/api/5/function/hook_form_alter http://api.drupal.org/api/5/function/hook_user http://api.drupal.org/api/5/file/developer/topics/forms_api_reference.html#s... http://api.drupal.org/api/5/group/database
Hi,
Neil: esl-lounge.com wrote:
Thanks Gordon,
would it thus be possible to use the hook_form_alter() to get the autocomplete to look in say location_towns BUT the value ultimately selected by the user is entered into the normal profile_values table? Just want to ensure I've understood that correctly.
Yes, you just change the form to call the lookup.
Scenario:
User A goes to fill out profile "City" field. Types "Sa..." and the following values appear:
San Antonio, Texas San Francisco, California (both present in our pre-populated location_towns table)
User selects San Antonio, Texas but only the value "San Antonio" gets entered into the profile_values table. Is that possible?
Yes what is displayed and what is loaded into the field can be different.
Gordon.
Neil
----- Original Message ----- From: "Gordon Heydon" gordon@heydon.com.au To: support@drupal.org Cc: info@urbits.com Sent: Wednesday, March 07, 2007 1:29 PM Subject: Re: [support] More effective use of auto-complete in Profile
Hi,
Neil: esl-lounge.com wrote:
Thanks for your response.
Unfortunately, I have a selection of 23,000 towns so that is not practical. Isn't there a way of getting the autocomplete to "look" in a different table for values?
Yes this is possible by altering the form using the hook_form_alter() and tell it use a different path to find the autocomplete.
Gordon.
N
----- Original Message ----- From: "sime" info@urbits.com To: support@drupal.org Sent: Wednesday, March 07, 2007 12:45 PM Subject: Re: [support] More effective use of auto-complete in Profile
The best you can do with profile module is to add "selection" field type and input your list right there.
HTH .s
Neil: esl-lounge.com wrote:
Is there a way of populating the profile_values table in the drupal DB before opening your site to the public?
I want the auto-complete to work and provide cities which I have already put into the database. At the moment, they only include cities that existing members have already entered.
Also, is there a way of providing extra information in the dropdown like you get on answers.com? If someone types "San Fr" I would like something similar to "San Francisco (California)" to appear. Is that possible?
Neil
No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.7/712 - Release Date: 3/6/2007 3:42 PM
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Thanks for the responses so far. As I am new to altering the underlying code, could someone point me at the right files that need changing.
I have created a db table called location_towns where I have my towns listed out and now need the autocomplete to look there. I looked on the profile.module file and couldn't see where I would need to change things.
neil
----- Original Message ----- From: "Gordon Heydon" gordon@heydon.com.au To: support@drupal.org Sent: Wednesday, March 07, 2007 11:16 PM Subject: Re: [support] More effective use of auto-complete in Profile
Hi,
Neil: esl-lounge.com wrote:
Thanks Gordon,
would it thus be possible to use the hook_form_alter() to get the autocomplete to look in say location_towns BUT the value ultimately selected by the user is entered into the normal profile_values table? Just want to ensure I've understood that correctly.
Yes, you just change the form to call the lookup.
Scenario:
User A goes to fill out profile "City" field. Types "Sa..." and the following values appear:
San Antonio, Texas San Francisco, California (both present in our pre-populated location_towns table)
User selects San Antonio, Texas but only the value "San Antonio" gets entered into the profile_values table. Is that possible?
Yes what is displayed and what is loaded into the field can be different.
Gordon.
Neil
----- Original Message ----- From: "Gordon Heydon" gordon@heydon.com.au To: support@drupal.org Cc: info@urbits.com Sent: Wednesday, March 07, 2007 1:29 PM Subject: Re: [support] More effective use of auto-complete in Profile
Hi,
Neil: esl-lounge.com wrote:
Thanks for your response.
Unfortunately, I have a selection of 23,000 towns so that is not practical. Isn't there a way of getting the autocomplete to "look" in a different table for values?
Yes this is possible by altering the form using the hook_form_alter() and tell it use a different path to find the autocomplete.
Gordon.
N
----- Original Message ----- From: "sime" info@urbits.com To: support@drupal.org Sent: Wednesday, March 07, 2007 12:45 PM Subject: Re: [support] More effective use of auto-complete in Profile
The best you can do with profile module is to add "selection" field type and input your list right there.
HTH .s
Neil: esl-lounge.com wrote:
Is there a way of populating the profile_values table in the drupal DB before opening your site to the public?
I want the auto-complete to work and provide cities which I have already put into the database. At the moment, they only include cities that existing members have already entered.
Also, is there a way of providing extra information in the dropdown like you get on answers.com? If someone types "San Fr" I would like something similar to "San Francisco (California)" to appear. Is that possible?
Neil
No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.7/712 - Release Date: 3/6/2007 3:42 PM
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
On Mar 7, 2007, at 4:58 AM, Neil: esl-lounge.com wrote:
Unfortunately, I have a selection of 23,000 towns so that is not practical. Isn't there a way of getting the autocomplete to "look" in a different table for values?
I wonder if it might be more direct to build off of the location module as it already works with user profiles and has this info in the us zipcodes table (albeit with some cities listed multiple times, listed once for each zip code contained within). Then the issue is doing the autocomplete ajaxy interface with otherwise existing functionality. Or am I missing something?
Laura
Laura,
I have already looked at the Location module and it isn't quite what I want, although I may revisit it. This is going to be a global site and the txt files available are not complete. Once I have a basic Profile/Register page set up with autocomplete working to gather users' towns, I may look to Location as a additional tool but it isn't complete enough (yet) to do what I want. Maybe I didn't spend enough time on it.
My original idea was to use dependent dropdowns as a way of avoiding free text boxes and cut down on misspellings, etc. It seems nye on impossible to get effective dependent dropdowns set up on Drupal and we have been pulling our hair out over the DependantDropdown module which is buggy and with zero documentation. So now our attention has turned to this autocomplete idea as long as we can pre-populate and if possible, add other info (such as state) to the dropdown itself once a user starts typing.
Thanks for your response.
Neil ----- Original Message ----- From: Laura Scott To: support@drupal.org Sent: Wednesday, March 07, 2007 5:47 PM Subject: Re: [support] More effective use of auto-complete in Profile
On Mar 7, 2007, at 4:58 AM, Neil: esl-lounge.com wrote:
Unfortunately, I have a selection of 23,000 towns so that is not practical.
Isn't there a way of getting the autocomplete to "look" in a different table
for values?
I wonder if it might be more direct to build off of the location module as it already works with user profiles and has this info in the us zipcodes table (albeit with some cities listed multiple times, listed once for each zip code contained within). Then the issue is doing the autocomplete ajaxy interface with otherwise existing functionality. Or am I missing something?
Laura
------------------------------------------------------------------------------
-- [ Drupal support list | http://lists.drupal.org/ ]
I am also looking for the same function for an international site. I am not a coder and have no idea about how to go about creating these dependent drop-downs. In the meantime, i would like to make due with a simple drop-down list of the global state/province list that is in civicrm.
I have created a custom (project) profile form in Drupal and would like to know the simplest way to export the global state/province list that is in civicrm into a cck custom field list. does anyone know how i can do this?
thanks, grace
*********** REPLY SEPARATOR ***********
On 3/7/2007 at 11:40 PM Neil: esl-lounge.com wrote: Laura,
I have already looked at the Location module and it isn't quite what I want, although I may revisit it. This is going to be a global site and the txt files available are not complete. Once I have a basic Profile/Register page set up with autocomplete working to gather users' towns, I may look to Location as a additional tool but it isn't complete enough (yet) to do what I want. Maybe I didn't spend enough time on it.
My original idea was to use dependent dropdowns as a way of avoiding free text boxes and cut down on misspellings, etc. It seems nye on impossible to get effective dependent dropdowns set up on Drupal and we have been pulling our hair out over the DependantDropdown module which is buggy and with zero documentation. So now our attention has turned to this autocomplete idea as long as we can pre-populate and if possible, add other info (such as state) to the dropdown itself once a user starts typing.
Thanks for your response.
Neil ----- Original Message ----- From: Laura Scott To: support@drupal.org Sent: Wednesday, March 07, 2007 5:47 PM Subject: Re: [support] More effective use of auto-complete in Profile
On Mar 7, 2007, at 4:58 AM, Neil: esl-lounge.com wrote:
Unfortunately, I have a selection of 23,000 towns so that is not practical. Isn't there a way of getting the autocomplete to "look" in a different table for values?
I wonder if it might be more direct to build off of the location module as it already works with user profiles and has this info in the us zipcodes table (albeit with some cities listed multiple times, listed once for each zip code contained within). Then the issue is doing the autocomplete ajaxy interface with otherwise existing functionality. Or am I missing something?
Laura