I thought this would be straight forward but my lack of drupal knowledge is holing me back. I want to grab the email from the logged in user, and set it as the default value of the form. I can grab the email from the global user logged in, but cannot pass this to the form?
The email field is blank, but I have the email stored in $email1
I want to place this value in the text box, as the default field.
global $user;
$user_full = user_load($user->uid);
$email1= $user_full ->mail;
echo $email1;
$form['admin_email'] = array (
'#type' => 'textfield',
'#title' => t('Admin Email need email validation!!!'),
'#description' => t('Please enter an Email'),
'#default_value' => $user_full->mail,
);