Community & Support

Add additional fields to user_register form and have them in a two column setup instead of one..how?

I have the following functional code but I am lost in how to add additional fields that would go in a 2 column setup. I know I may have to over right a template in my module but how? I have been struggling with this for hours now

<?php

/**
* Implementation of hook_menu().
*/

function modulename_menu() {
$items = array();
$items['student/registration'] = array(
      'title' => 'Register Now',
      'page callback'    =>'modulename_student_register',
      'access arguments' => array('access content'),
      'type' => MENU_CALLBACK           
    );

return $items;
}//end of the function



function modulename_student_register(){

return drupal_get_form('user_register');

}//end of the function


function modulename_form_alter(&$form, $form_state, $form_id)
{
   if ($form_id == 'user_register')
   {


//print_r($form);

// modify the "#submit" form property by prepending another submit handler array
$form['#submit'] = array_merge(
      array('modulename_registration_submit' => array()),
      $form['#submit']
    );

   }
}



function modulename_form_submit($form_id, $form_values) { // IS THIS FUNCTION NAMES PROPERLY ?
 
  //save extra fields in form to another table
}

Comments

Add your fields in

Add your fields in hook_user() $op == 'form'.

To make it two columns, define hook_menu(). Add a theme for 'user_register'. In your theme function, you can turn it into two columns.

Full-time freelancer, always looking for work.
jaypan.com (my portfolio)

nobody click here