I am trying to build a new form from the user registration form and while the user reg parts are appearing the new fields are not. Any ideas? The code is below. I tried having the fields in the primary array level AND under the account parameter.
When the array prints out it shows the parameters are there. So I am having trouble figuring out why it is not working. I am used to doing this in Drupal 6. But in Drupal 7 it is not cooperating.
function custom_reg_company_registration() {
return drupal_get_form('custom_reg_company_form');
}
function custom_reg_company_form($form, &$form_state) {
$form = user_register_form($form, $form_state);
$form['company_name'] = array(
'#type' => 'textfield',
'#title' => 'Company Name',
'#maxlength' => 60,
'#description' => 'The name of your company.',
'#required' => 1,
'#attributes' => array(
'class' => array(0 => 'company_name'),
),
'#default_value' => '',
'#access' => 1,
'#weight' => -10,
);
$form['primary_phone'] = array(
'#type' => 'textfield',
'#title' => 'Primary Phone',
'#maxlength' => 30,
'#description' => 'The primary phone number for your company.',
'#required' => 1,
'#attributes' => array(
'class' => array(0 => 'primary_phone'),
),
'#default_value' => '',
'#access' => 1,
'#weight' => -10,
);
$form['secondary_phone'] = array(
'#type' => 'textfield',
'#title' => 'Secondary Phone',
'#maxlength' => 30,
'#description' => 'The secondary phone number for your company.',
'#required' => 0,
'#attributes' => array(
'class' => array(0 => 'secondary_phone'),
),
'#default_value' => '',
'#access' => 1,
'#weight' => -10,
);
$form['company_type'] = array(
'#type' => 'radios',
'#title' => 'Company Type',
'#maxlength' => 30,
'#description' => 'The type of company you are setting up.',
'#required' => 1,
'#default_value' => 0,
'#weight' => -10,
'#options' => array(
0 => 'Carrier',
1 => 'Broker & FF',
2 => 'Shipper',
),
);
$form['#action'] = url('register/company');
echo "<pre>" . print_r($form, true) . "</pre>";
return $form;
}