-1

Please any one help me to how I can do customizing User/Registration page in Drupal7. For ex I have a select option for user group suppose if I choose 'others' option ’ then user is allowed to create new group in separate text box.

I'm new to drupal. Please anyone help me

Karthick V
  • 1,269
  • 5
  • 16
  • 31

1 Answers1

1

You can create a custom module and use hook_form_alter.

You can then modify the form by adding drupal form elements.

function custom_module_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id === 'user_register_form') {
    $form['account']['other'] = array(
      '#type' => 'select',
      '#title' => t('Other'),
      '#options' => array(
        0 => t('No'),
        1 => t('Yes'),
      ),
    );
    $form['account']['group'] = array(
      '#type' => 'text_format',
      '#title' => t('Group'),
      '#default_value' => '',
      '#format' => NULL,
    );
  }
}
tchow002
  • 1,068
  • 6
  • 8