 readme  id description this module adds an extra tab to each webform node allowing you to specify validation rules for your webform components you can create one or more of the predefined validation rules and select which webform component s should be validated against those by using the hooks provided by this module you can also define your own validation rules in your own modules the following validation rules are currently included numeric values optionally specify min and or max value minimum length maximum length equal values on multiple fields unique values on multiple fields specific value require at least one of two fields require at least one of several fields minimum number of selections required maximum number of selections allowed exact number of selections required plain text disallow tags regular expression must be empty antispam hide with css words blacklist installation 1 place the module folder in your sites all modules folder 2 make sure you have the webform module enabled 3 activate the module via admin build modules usage once you have installed the module an extra tab will appear on the node s webform management pages tab edit in webform 2x tab webform in webform 3x this extra tab is labeled webform validation upon selecting this tab you can choose to add one of the available validation rules to your webform make sure you have added the webform components you wish to validate before adding the validation rule after clicking the link to add the desired validation rule you can specify the following details for your rule an administrative name to describe the validation rule one or more webform components that should be validated against this rule depending on the chosen rule you will have to select a specific number of components for the validation rule to work properly depending on the chosen rule more form fields will be available on the rules form optionally an extra setting to further configure the rule optionally a custom error message textfield once you have configured your desired validation rules for the selected webform components every time a user fills in the webform the validation will be triggered for the selected components and show the user a standard form error message when entered data doesn t pass the validation rule you have set up adding custom validation rules the following steps will let you add custom validators through your module 1 implement hook hookwebformvalidationvalidators this hook implementation should return an array of validator key options array entries the options array can contain the following configuration keys name required name of the validator component types required defines which component types can be validated by this validator specify all to allow all types customerror optional define whether a user can specify a custom error message upon creating the validation rule customdata optional define whether custom data can be added to the validation rule mincomponents optional define the minimum number of components to be selected for creating a validation rule maxcomponents optional define the maximum number of components to be selected for creating a validation rule description optional provide a descriptive explanation about the validator see function webformvalidationwebformvalidationvalidators in webformvalidationvalidatorsinc for a live example 2 implement hook hookwebformvalidationvalidate validatorname items components rule this hook gets passed 4 parameters which will allow you to react to your custom validator or any other validator for that matter explanation about these parameters validatorname this is the validator name ie array key as entered in hookwebformvalidationvalidators items array containing user submitted entries to be validated components this array contains the definitions of the webform components in your form rule this array contains the details of your validation rule see function webformvalidationwebformvalidationvalidate in webformvalidationvalidatorsinc for a live example additional hooks the hook hookwebformvalidation type op data can be used to react on various webformvalidation based actions type possible values rule op possible values add edit delete data array with rule data in case of op add edit rule id in case of op delete the hook hookwebformvalidatoralter validators can be used to alter the array of validators that is being generated by hookwebformvalidationvalidators validators array of validators as supplied by modules implementing hookwebformvalidationvalidators author sven decabooter http drupalorg user 35369 the author can be contacted for paid customizations of this module as well as drupal consulting and development  