function twilio_user_settings_add_form_validate in Twilio 7
Validation function for user settings form.
@todo Please document this function.
See also
1 string reference to 'twilio_user_settings_add_form_validate'
- twilio_user_settings_form in ./
twilio.pages.inc - User settings form.
File
- ./
twilio.pages.inc, line 128 - User facing pages
Code
function twilio_user_settings_add_form_validate($form, &$form_state) {
$value = $form_state['values']['number'];
if (!is_numeric($value)) {
form_set_error('number', t('You must enter a valid phone number'));
}
elseif (twilio_verify_duplicate_number($form_state['values']['number'])) {
form_set_error('number', t('This number is already in use and cannot be assigned to more than one account'));
}
}