You are here

function twilio_admin_test_form_validate in Twilio 7

Validation handler for the administrative test message form.

File

./twilio.admin.inc, line 135
Administrative forms section

Code

function twilio_admin_test_form_validate($form, &$form_state) {
  $value = $form_state['values']['number'];
  if (!is_numeric($value)) {
    form_set_error('number', t('You must enter a phone number'));
  }
  if (!empty($form_state['values']['media']) && !valid_url($form_state['values']['media'], TRUE)) {
    form_set_error('media', t('Media must be a valid URL'));
  }
}