update user's profile field from another form Here is what I need to achieve:


There is field "linkedIn url" in user's profile entity. 
There is Event registration form on the website.
In the Event Registration form I would like to render field "linkedIn url" with value from the user's profile entity.
When user submits the Event Registration I want to save a value of the field to the database (to user profile entity of course).


Any suggestions? thx!



EDIT:
I implemented this functionality. 
For those interested, complete source code is below:
(Note that I'm saving data to profile2!)

/**
*
* Implements hook_form_alter
*
*/
function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    global $user;
    if ($form_id == 'registration_form') {
            $profile = profile2_load_by_user($user-&gt;uid); // Load profile2 data
            if ($profile['main']-&gt;field_linkedin_url) {
                $linkedin_url = $profile['main']-&gt;field_linkedin_url['und'][0]['value'];
            } 
            $form['linkedin_url'] = array( // Add field to form
                '#type' =&gt; 'textfield',
                '#title' =&gt; t('Your LinkedIn profile'),
                '#default_value' =&gt; isset($linkedin_url) ? $linkedin_url : '',
                '#maxlength' =&gt; 255,
                '#size' =&gt; 60,              
                '#description' =&gt; t('Please enter your LinkedIn profile URL'),
                '#weight' =&gt; 10,
            );          
            $form['#submit'][] = 'entity_registration_custom_registration_form_submit'; // Call custom submit handler

    }
}


/**
*
* Custom Form Submit Handler
*
*/
function  MYMODULE_MYFORM_submit($form, &amp;$form_state){
    global $user;
    $profile = profile2_load_by_user($user-&gt;uid); // Load profile2 data
    $profile['main']-&gt;field_linkedin_url['und'][0]['value'] =  $form_state['values']['linkedin_url']; // Set new value for Profile2 field
    profile2_save($profile['main']);
    drupal_set_message(t('Submit handler works!'));
}
You have to modify your form in a hook_form_alter : and the linked_in url will appear in the event registration form

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id){
   if ($form_id == 'eventregistration_node_form'){

      // Find the user obj
      global $user;
      // Load all profile fields
      $account = user_load($user-&gt;uid);
      // Add the linked_in url in the event registration form
      // Supposing your field madhine name is ; linkedin_url
      // Supposing you use the link module for this field (if not, change ['url'] to ['value']
      $form['linkedin_url']['und'][0]['url']['#default_value'] = $user-&gt;linkedin_url['und'][0]['url'];
   }
}


If you don't want to expose the linked_in field during the form do this :

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id){
   if ($form_id == 'eventregistration_node_form'){
     // Hide your field
     $form['linkedin_url'][und]['#access']  = false;
     //Add another submit function
      $form['actions']['submit']['#validate'][] = 'mymodule_eventregistration_validate_form_alter';
   }
}

// Your submit function
function mymodule_eventregistration_validate_form_alter($form, $form_alter){

     // Find the user obj
      global $user;
      // Load all profile fields
      $account = user_load($user-&gt;uid);
      // Add the linked_in url in the event registration form
      // Supposing your field madhine name is ; linkedin_url
      // Supposing you use the link module for this field (if not, change ['url'] to ['value']
      $linkedin_url = $user-&gt;linkedin_url['und'][0]['url'];

    form_set_value($form['linkedin_url'], array('und' =&gt; array(0 =&gt; array('url' =&gt; $linkedin_url))), $form_state);
}