Hi,
I am using form_alter to change the display of some elements, and I'm having some issues saving the data to the database.
My question is: From within the s_user_save function which I have printed below, how do I access the values as saved within the profile_age1 (and profile_age2 and others) element within the form?
I have print_r'ed $user and $edit, and they do not contain the values I have entered, either containing blank values ($edit) or the current databased values ($user (not the global one)).
form_alter contains:
unset($form['section 2']['profile_age1']['#title']);
$form['section 2']['profile_age1']['#id'] = "edit-profile_age1";
$form['section 2']['profile_age1']['#name'] = "edit[profile_age1]";
$form['section 2']['profile_age1']['#parents'] = array('profile_age1');
$form['section 2']['profile_age1']['#value'] = $user->profile_age1;
$a1 = form_render($form['section 2']['profile_age1']);
$form['section 2']['age'] = array('#type'=>'markup', '#value' => $a1);
and, hook_user contains:
switch ($type) {
case 'update':
case 'insert':
s_user_save($edit, $user, $category);
break;