Included in Drupal is an AJAX library that integrates Drupal, jQuery, and AJAX. This system provides a set of properties for forms and functions, to use in Drupal callbacks, which quickly and easily build AJAX into Drupal modules. Using the helper functions and properties AJAX can be built into Drupal pages rather than bolted into the pages.
A common use of AJAX is dynamically updating forms, based on input, to other parts of the form. When one element in the form is updated, other elements change or are populated with information based on a change. For an example, we can look at an option list form element that updates a markup element.
We start with an implementation of
hook_menu() to define the form page, as ...