1 form_example_elements.inc form_example_element_demo_form_submit($form, &$form_state)

Submit handler for form_example_element_demo_form().

File

modules/examples/form_example/form_example_elements.inc, line 511
This is an example demonstrating how a module can define custom form and render elements.

Code

function form_example_element_demo_form_submit($form, &$form_state) {
  // Exclude unnecessary elements.
  unset($form_state['values']['submit'], $form_state['values']['form_id'], $form_state['values']['op'], $form_state['values']['form_token'], $form_state['values']['form_build_id']);

  foreach ($form_state['values'] as $key => $value) {
    config_set('form_example.settings', $key, $value);
    backdrop_set_message(
    t('%name has value %value', 
    array(
      '%name' => $key,
      '%value' => print_r($value, TRUE),
    )
    )
    );
  }
}