[support] Drupal 7: How to set values (allowed_values) for field (select) dynamically (from module)?

Vaibhav Jain in.vaibhavjain at gmail.com
Sat Jun 30 01:24:27 UTC 2012


to populate options in select list, you can call a function in the cck /
fieldapi UI and that function do all the trick.
I believe this can be done without form alter.

On Fri, Jun 29, 2012 at 9:59 PM, Juraj Chlebec <havran at gmail.com> wrote:

> Hi,
>
> I now about hook_form_alter() for modification form elements, but i have
> bad feeling use arrays like:
>
> $form['profile_main']['field_year_of_graduation'][LANGUAGE_NONE][0]
>
> I think sometimes can be LANGUAGE_NONE index changed and then my code not
> work.
>
> Is there better way for set allowed_values dynamically or i need create my
> custom field?
>
> Havran
>
> --
> Juraj Chlebec aka Havran
> http://www.svoji.sk
>
>
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>



-- 
Regards,
Vaibhav Jain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20120630/bd25a6d7/attachment.html 


More information about the support mailing list