ajax_example_submit_driven_callback

7 ajax_example.module ajax_example_submit_driven_callback($form, $form_state)
8 ajax_example.module ajax_example_submit_driven_callback($form, $form_state)

Select the 'box' element, change the markup in it, and return it as a renderable array.

Return value

renderable array (the box element)

Related topics

1 string reference to 'ajax_example_submit_driven_callback'

File

ajax_example/ajax_example.module, line 437
AJAX Examples module file with basic examples.

Code

function ajax_example_submit_driven_callback($form, $form_state) {
  // In most cases, it is recomended that you put this logic in form generation
  // rather than the callback. Submit driven forms are an exception, because
  // you may not want to return the form at all.
  $element = $form['box'];
  $element['#markup'] = "Clicked submit ({$form_state['values']['op']}): " . date('c');
  return $element;
}
Login or register to post comments