Posted By

kosmikko on 11/16/09


Tagged

textmate drupal FAPI


Versions (?)

Move form element


 / Published in: PHP
 

Move form element into category. Helper for organizing the form

  1. function move_form_element(&$form, $name, $new_category, $weight = NULL)
  2. {
  3. $form[$new_category][$name] = $form[$name];
  4. if($weight != NULL)
  5. {
  6. $form[$new_category][$name]['#weight'] = $weight;
  7. }
  8. unset($form[$name]);
  9. }

Report this snippet  

You need to login to post a comment.