Adds element validators to Drupal that that fit into Drupal's form API. Instead of writing the (almost) same _validate function over and over, you can use the element's #element_validate property when building a custom form. Drupal doesn't provide out-of-the-box functions to assign to that. (You'd still have to write the validation shell yourself.) This module does.

Implemented:

  • value_is_integer (with optional #min and/or #max).
  • value_is_number (with optional #min and/or #max).
  • value_is_email.
  • value_is_username (with optional #exists for it is has to exist).
  • Fixes Drupal core's 'file' element #required bug, so now you can actually use #required for non-managed files.
  • Improves Drupal core's 'checkboxes' element, so now you can use #disabled_options and #hidden_options to customize your checkboxes/options list. (With server side validation!)

Project information

Releases