This site is archived.

Instant Dynamic Forms with #states

9:45 AM - 10:45 AM
308 Rackspace

Presented by

Konstantin Käfer (kkaefer)
NowPublic Technologies Inc.
Under the HoodUnder the Hood
Technical details: Study servers, Drupal core, module building, and more.

The new #states system in Drupal 7’s Form API enables you to quickly add dependencies between form elements, transitions between arbitrary states of a form and on-the-fly input validation. In this talk, you’ll get to know how you can use the system to enhance your own forms without writing any boilerplate JavaScript code. All you have to do is to declare in what state your form should be when something happens—the #states system will do the rest for you!

In case #states doesn’t yet exactly do what you want, you’ll also learn how to extend it with your own transitions, conditions and events. It’s also possible to add custom form validation.

For the curious, we’ll also have a look at the internals of the #states system and examine its mechanisms so that you’ll be able to fully comprehend the magic that goes on behind the scenes.


  • Tour of the #states system
  • Adding interactivity to your forms
  • Extending #states
  • Internals of the #states system


Konstantin Käfer is currently studying IT Systems Engineering at the Hasso Plattner Institute in Potsdam, Germany. For his bachelor’s degree, he is building a multi-touch floor and researching how users interact with a floor. He also works as a consultant for NowPublic, a crowd-powered news website using Drupal. He joined the Drupal community as a Google Summer of Code Student in 2006. Together with Emma Jane Hogbin, he authored the theming book “Front End Drupal”.

Experience: Intermediate, Advanced, Expert
Industry: education, entertainment, library, marketing, media, non-profit