You are here

function _clientside_validation_set_phone in Clientside Validation 7

1 call to _clientside_validation_set_phone()
clientside_validation_regular in clientside_validation_form/clientside_validation_form.module

File

./clientside_validation.module, line 1291
Add client side validation to forms.

Code

function _clientside_validation_set_phone($name, $title, $country_code, &$js_rules, $message = "") {
  $title = _clientside_validation_set_title($title);
  $js_rules[$name]['phone'] = $country_code;
  $variables = array(
    'message' => empty($message) ? 'The value in !title is not a valid phone number.' : $message,
    'placeholders' => empty($message) ? array(
      '!title' => $title,
    ) : array(),
    'error_type' => 'phone',
    'element_name' => $name,
  );
  $js_rules[$name]['messages']['phone'] = theme('clientside_error', $variables);
}