O'Reilly logo

Drupal 7 Module Development by Ken Rickard, John Wilkins, Larry Garfield, Matt Butcher, Greg Dunlap, Matt Farina

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

AJAX helpers

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.

Adding AJAX to forms

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required