Group all user registration fields into one fieldset


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function MY_MODULE_form_user_register_alter(&$form, &$form_state) {
  2. $profileFieldset= 'About You'; // CHANGE TO YOUR GROUP
  3. // cluster all fields into one fieldset
  4. foreach($form[$profileFieldset] as $key => $item) {
  5. // push field to account fieldset
  6. if( substr($key,0,8)=='profile_' ) $form['account'][$key] = $item;
  7. }
  8. unset($form[$profileFieldset]);
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.