AJAX Forms Validation

brendoncrawford - April 12, 2008 - 20:41

By default in Drupal, when a form is submitted, the values of that form are sent through a series of Drupal validation procedures. When these validations are completed the validation messages are normally sent back to the user with a standard page refresh.

For example, if a user fills out a form which requires a first name, but the user leaves these fields blank, they will be presented with a message that says "First Name is Required".

This module allows the validation messages to be sent back to the user without a page refresh, so they appear in realtime. This makes for a more streamlined user experience. This module works well with Lightbox/Thickbox as well.

Configuration is very simple. Go to "admin/settings/ajax-validation". Select the node/form types for which you want to use Ajax Validation. Thats it.

To test the module, go to one of the forms which you selected. For example if you selected "Blog", then go to "node/add/blog". Then fill out the form, intentionally inputting invalid data or leave a required field blank. Submit the form. You should then see the validation messages appear at the top of the form near-instantaniously.

Please note that this module requires the JSON extension for PHP. Fortunately, JSON is bundled by default with PHP 5.2+ unless the --disable-json or --disable-all configuration options are provided when building PHP.

This module also requires jQuery, which is bundled with Drupal 5 by default.

Releases

Development snapshotsDateSizeLinksStatus
5.x-1.x-dev2008-Apr-157.5 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.
 
 

Drupal is a registered trademark of Dries Buytaert.