You are here

function _googleanalytics_validate_create_field_value in Google Analytics 7.2

Same name and namespace in other branches
  1. 6.4 googleanalytics.admin.inc \_googleanalytics_validate_create_field_value()

Checks whether a field value is valid.

Parameters

string $value: The option value entered by the user.

Return value

string The error message if the specified value is invalid, NULL otherwise.

1 call to _googleanalytics_validate_create_field_value()
googleanalytics_validate_create_field_values in ./googleanalytics.admin.inc
#element_validate callback for create only fields.

File

./googleanalytics.admin.inc, line 835
Administrative page callbacks for the googleanalytics module.

Code

function _googleanalytics_validate_create_field_value($value) {
  if (!is_bool($value) && !drupal_strlen($value)) {
    return t('A create only field requires a value.');
  }
  if (drupal_strlen($value) > 255) {
    return t('The value of a create only field must be a string at most 255 characters long.');
  }
}