Download & Extend

how to incorporate addresses in my form (hook_elements)

Project:Addresses
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hello,

At first I wanted to add an addresses subform in my form. After some time looking at the core , I was able to incorporate the addresses in my form with such code:

  // Get the fields used on this address
  $fields = variable_get('addresses_user', array());

  $form['addresses'] = array(
    '#default_value'  => $values,
    '#fields'         => $fields,
    '#uid'            => $user->uid,
    '#type'           => 'addresses_elements',
    '#tree'           => TRUE
  );

Now I woud like that this magic definition should be able to load the addresses of an user and update it when changes are made !

But I don't known how ?

Thank you in advance,
Michel

nobody click here