You are here

public function CvElementsMaxValidator::getMessage in Clientside Validation 7.2

Overrides ClientsideValidationValidator::getMessage

1 call to CvElementsMaxValidator::getMessage()
CvElementsMaxValidator::getJavascriptSettings in clientside_validation_elements/plugins/validator/elementsmax.inc

File

clientside_validation_elements/plugins/validator/elementsmax.inc, line 46

Class

CvElementsMaxValidator

Code

public function getMessage(array $element) {
  $step = isset($element['#step']) ? $element['#step'] : 1;
  return drupal_strtolower($step) == 'any' ? t('!title field has to be smaller than @max', array(
    '!title' => $element['#title'],
    '@max' => $element['#max'],
  )) : t('!title field has to be smaller than @max with steps of @step.', array(
    '!title' => $element['#title'],
    '@max' => $element['#max'],
    '@step' => $step,
  ));
}