1 ajax_example_advanced.inc ajax_example_advanced_commands_restripe_num_rows($form, $form_state)

Callback for 'restripe'.

Rebuilds the table with the selected number of rows.

File

modules/examples/ajax_example/ajax_example_advanced.inc, line 382
AJAX Commands examples.

Code

function ajax_example_advanced_commands_restripe_num_rows($form, $form_state) {
  $num_rows = $form_state['values']['restripe_num_rows'];
  $output = "<table id='restripe_table' style='border: 1px solid black'>";
  for ($i = 1; $i <= $num_rows; $i++) {
    $output .= "<tr><td>Row $i</td></tr>";
  }
  $output .= "</table>";
  return $output;
}