AHAH

Theme the AHAH progress animation

 

Having a hard time to catch the Drupal AHAH animation in Firebug? This is how it looks like. Add it after your button in Edit, and now you can style it.

 

<?php
<input type="submit" name="op" value="Go" class="form-submit ahah-processed progress-disabled" id="edit-go">
<
div class="ahah-progress ahah-progress-throbber" style="display: block;">
<
div class="throbber">&nbsp;</div>
</
div>
?>

 

How to reset a form on AHAH drupal_jason call

This is how you can reset a form on a Drupal AHAH call by sending a JavaScript with the drupal_json call.

 

<?php
   $domaintable
= _get_domain_table($_POST['uid']);

  
$domaintable .= '<script type="text/javascript">
                    var domainForm = document.getElementById("domainuser-add-domain-form");
                    domainForm.reset();
                    </script>'
;

   return
drupal_json($domaintable);
   exit();
?>

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