You are here

function nodewords_max_size_validate in Nodewords: D6 Meta Tags 6

Function to validate the value entered for the maximum meta tags length.

1 string reference to 'nodewords_max_size_validate'
nodewords_settings_form in ./nodewords.admin.inc
Menu callback: settings form.

File

./nodewords.admin.inc, line 392
Administration interface for nodewords.module.

Code

function nodewords_max_size_validate($element, &$form_state) {
  if (!empty($element['#value'])) {
    $value = trim($element['#value']);
    if (empty($value) || !empty($value) && (!is_numeric($value) || $value <= 0)) {
      form_error($element, t('The maximum length must be a number greater than zero.'));
    }
  }
}