You are here

function sms_actions_edit_command_form_validate in SMS Framework 7

Same name and namespace in other branches
  1. 6.2 modules/sms_actions/sms_actions.module \sms_actions_edit_command_form_validate()
  2. 6 modules/sms_actions/sms_actions.module \sms_actions_edit_command_form_validate()

Validate handler for sms_actions_edit_command_form().

See also

sms_actions_edit_command_form()

1 call to sms_actions_edit_command_form_validate()
SmsActionsUnitTest::testDiscriminatorValidation in modules/sms_actions/sms_actions.test

File

modules/sms_actions/sms_actions.module, line 462
Provides a "Send SMS" action and the ability to define custom triggers for incoming messages.

Code

function sms_actions_edit_command_form_validate($form, &$form_state) {
  if (!preg_match('!^[a-z0-9\\-]+$!', $form_state['values']['discriminator'])) {
    form_set_error('discriminator', t('The discriminator may only consist of lowercase letters, dashes, and numbers.'));
  }
}