Hello,

I am trying to add some custom fields on the signup form through the theme hooks. The custom data is not appearing anywhere in extra information, it is not being saved to the signup log table. I have a fresh install of all the modules(signup, status, etc...) on a Drupal 5.7 install. The only additional module that I have installed is LDAP. I have custom profile fields created too. I have used your module before and not had this problem, it worked like a gem. The custom fields seem to be working fine, except that no data is being saved.

Do you have any idea why this could be happening or is this a bug?

My boss is really on my case about this, so I would really appreciate your help.

Here is a sample of my code that is in template.php

function pixture_signup_user_form()
{
global $user;
$profile = profile_load_profile($user);

$form['signup_form_data']['#tree'] = TRUE;

$form['username'] = array(
'#type' => 'textfield',
'#title' => t('UCID'),
'#value' => $user->name,
'#size' => 40,
'#maxlength' => 64
);

$form['first_name'] = array(
'#type' => 'textfield',
'#title' => t('First Name'),
'#value' => $user->profile_fname,
'#size' => 40,
'#maxlength' => 64
);

$form['last_name'] = array(
'#type' => 'textfield',
'#title' => t('Last Name'),
'#value' => $user->profile_lname,
'#size' => 40,
'#maxlength' => 64
);

return $form;
}

CommentFileSizeAuthor
template.php_.txt2.27 KBkaw3939

Comments

dww’s picture

Category: bug » support
Status: Active » Closed (works as designed)

Please re-read the comment in signup.theme at the top of function theme_signup_user_form(), and look at the example code provided with the module. In particular:

* In order for the form to be rendered properly, the name of the form
* element must be $form['signup_form_data']['NameOfDataField'], where
* NameOfDataField is replaced with the actual name of the data field.
* We suggest that the displayed name of the field (the '#title'
* property) be the same as the name of the data field, but it's not
* required. See below for examples.

Good luck,
-Derek

kaw3939’s picture

Thanks