multipage_form_example_custom_submit

Definition

multipage_form_example_custom_submit()
developer/examples/multipage_form_example.module, line 285

Code

<?php
function multipage_form_example_custom_submit() {
  global $form_values;
  foreach ($form_values as $key => $value) {
    if (in_array($key, array('fav_person', 'fav_person_desc', 'fav_gummi', 'fav_color', 'fav_number', 'fav_movie', 'fav_tv',))) {
      $array[$key] = $value;
    }
  }

    // A little hack so we can save new node info properly to the variable table
  if (isset($form_values['nid'])) {
    $nid = $form_values['nid'];
  }
  else {
    $nid = db_result(db_query("SELECT id FROM {sequences} WHERE name = 'node_nid'"));
  }

  variable_set('multipage_form_example_'. $nid, $array);
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.