You are here

function sms_sendtophone_form_validate in SMS Framework 7

Same name and namespace in other branches
  1. 5 modules/sms_sendtophone/sms_sendtophone.module \sms_sendtophone_form_validate()
  2. 6.2 modules/sms_sendtophone/sms_sendtophone.module \sms_sendtophone_form_validate()
  3. 6 modules/sms_sendtophone/sms_sendtophone.module \sms_sendtophone_form_validate()

Validate handler for sms_sendtophone_form().

See also

sms_sendtophone_form_submit()

File

modules/sms_sendtophone/sms_sendtophone.module, line 436
Provides various tools for sending bits of information via SMS.

Code

function sms_sendtophone_form_validate($form, &$form_state) {
  if (!($form_state['values']['number'] = sms_formatter($form_state['values']['number']))) {
    form_set_error('number', t('Please enter a valid phone number.'));
  }
  if (empty($form_state['values']['gateway'])) {
    $form_state['values']['gateway'] = array();
  }
}