I'm really sorry but I can't understand how to generate my list programmatically in the "Autocomplete for allowed values list" widget (I'd like to query the db to do that).

Maybe it's a drupal 6 only feature?

thanks!
Mt

Comments

bleen’s picture

Status: Active » Closed (works as designed)

This is something you should be able to do in a number of ways .. this is a blog post that you should be able to apply here:
http://sivaji.drupalgardens.com/how-programmatically-change-field-instan...

seren10pity’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta2

Hi, my question isn't how, but where :

In the "allowed values" field of Autocomplete settings page, I can't write php. I thought I would just need to use a hook_form, but I can't see the options list I used to test the field in it...
Maybe it's an idiot question, but WHERE am I supposed to add my php snippet to generate allowed values ?
Or with witch widget ?

thanks ;)

acb’s picture

I too would like to know the answer to this question.... where does one generate allowed-values programatically?

fureigh’s picture

  1. Enable the core PHP module.
  2. Enable the CCK module (download it first if necessary).
  3. Make sure the "Use PHP input for field settings" permission is granted to your user role.

That should make the 'PHP code' box appear.