[support] More effective use of auto-complete in Profile

Neil: esl-lounge.com neil at esl-lounge.com
Thu Mar 8 01:01:21 UTC 2007


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 at heydon.com.au>
To: <support at 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 at heydon.com.au>
>> To: <support at drupal.org>
>> Cc: <info at 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 at urbits.com>
>>>> To: <support at 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/ ]
> 



More information about the support mailing list