Field validation
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
This module adds an extra tab to each field instance, allowing you to specify validation rules for your field instances.
The following validators are currently included (7.x-2.x):
- Regular expression
- Numeric values (optionally specify min and / or max value)
- length (optionally specify min and / or max length)
- number of words (optionally specify min and / or max words )
- Plain text (disallow tags)
- Must be empty (Anti-Spam: Hide with CSS)
- Words blacklist
- number of selections (optionally specify min and / or max selections )
- Unique
- Match against a field
- Match against a property
- Specific value(s)
- Require at least one of several fields
- Equal values on multiple fields
- Unique values on multiple fields
- PHP Code (powerfull but dangerous)
- URL (support internal path and external url validation)
- Pattern (Regular expression lite)
- Date range2
Following validators are included in sub module field validation extras:
- Color(HTML5)
- Date(ISO)
- EAN number
- Field collection unique
- Integer values
- IP Address
- Numeric(HTML5, with the option to specify min/max/step)
- Regular expression (Perl-Compatible)
- Phone
- Required field
- Require some of several fields
- Postal code(depend on Postal Code Validation, support Address Field)
Since 7.x-2.1, we add another sub module property validation which could solve validation issues for property(non-field), such as title, Ubercat SKU, list_price.
Drupal8:
1, first make sure that the Field validation ruleset machine name using following pattern:
"Your Entity type" + '_' + "bundle", for example:
Entity type:node
bundle:article
So the Field validation ruleset machine name must be:
node_article
2, column is "value" or 'target_id' or ...
the UI will be improved in the future, use selection instead of input.
3, there are only a few validation rules:
Email,Regex,Length,Must be Empty, Unique, date range, blacklist, words count, integer, Ip, numeric, phone, plain text .
we will add more in the future.
Requirements
- Ctools
- Entity API ( Property validation)
Documentation
Lullabot write a doc for this module:Write complex validation rules for your fields, http://www.lullabot.com/articles/module-monday-field-validation
Docs on drupal.org: http://drupal.org/node/1299698
Date range document: http://drupal.org/node/1438436
PHP code validator document: https://www.drupal.org/node/1537028
related modules
Sponsors:
- This module was sponsored by Think in Drupal
Authour:
The author can be contacted for paid customizations of this module as well as Drupal consulting and development.
