You are here

function rules_action_callback_validate in Rules 6

The configuration form validation callback for an action.

It should be placed into the file MODULENAME.rules_forms.inc or into MODULENAME.rules.inc.

This callback can be implemented to validate the action's configuration form.

Parameters

$form: The configuration form.

$form_state: The form's form state.

See also

rules_action_callback_form(), rules_action_callback_submit()

Related topics

File

rules/rules.api.php, line 212
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function rules_action_callback_validate($form, $form_state) {
  if (!$form_state['values']['settings']['username'] && !$form_state['values']['settings']['userid']) {
    form_set_error('username', t('You have to enter the user name or the user id.'));
  }
}