You are here

function ajax_example_advanced_commands_html_callback in Examples for Developers 7

Callback for 'html'.

See also

ajax_command_html()

1 string reference to 'ajax_example_advanced_commands_html_callback'
ajax_example_advanced_commands in ajax_example/ajax_example_advanced.inc
Form to display the AJAX Commands.

File

ajax_example/ajax_example_advanced.inc, line 335
AJAX Commands examples.

Code

function ajax_example_advanced_commands_html_callback($form, $form_state) {
  $text = $form_state['values']['html_command_example'];
  $commands = array();
  $commands[] = ajax_command_html('#html_div', $text);
  $commands[] = ajax_command_replace("#html_status", "<div id='html_status'>Updated html_command_example with text={$text};  " . date('r') . "</div>");
  return array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
}