drupal_json AHAH jquery

Adding dynamic form elements using AHAH

function qt_more_tabs_submit($form, &$form_state) {
  unset($form_state['submit_handlers']);
  form_execute_handlers('submit', $form, $form_state);
  $quicktabs = $form_state['values'];
  $form_state['quicktabs'] = $quicktabs;
  $form_state['rebuild'] = TRUE;
  if ($form_state['values']['tabs_more']) {
    $form_state['qt_count'] = count($form_state['values']['tabs']) + 1;
  }
  return $quicktabs;
}

$javascript = drupal_add_js(NULL, NULL, 'header');
  drupal_json(array(
    'status'   => TRUE,
    'data'     => theme('status_messages') . drupal_render($qt_form),
    'settings' => call_user_func_array('array_merge_recursive', $javascript['setting']),
  ));
Knowledge keywords: