How to override form just on one page?
- by user363036
OK so this is my hook form alter function.It is causing all the registration forms on site to be over written which I do not want as I just want it on this page.
function special_registration_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'user_register') {
drupal_set_title(t('Custom registration'));
$form['firstname'] = array('#type' = 'textfield',
'#title' = t('First Name: *'),
'#required' = TRUE,
'#size' = 45,
'#weight' = - 100,);
$form['lastname'] = array('#type' = 'textfield',
'#title' = t('Last Name: *'),
'#required' = TRUE,
'#size' = 45,
'#weight' = - 99,);
}
I only first name and last name to be captured and stored in a different table just on this page.
On other pages I just want the good old fashioned form. Do I still need to change the weight? I know I am missing something elementary.