You are here

function nodewords_extra_location_longitude_form_validate in Nodewords: D6 Meta Tags 6

Validate the value passed as longitude.

1 string reference to 'nodewords_extra_location_longitude_form_validate'
nodewords_extra_location_form in nodewords_extra/nodewords_extra.module
Set the form fields used to implement the options for the meta tag.

File

nodewords_extra/nodewords_extra.module, line 615
Define extra meta tags for Drupal pages.

Code

function nodewords_extra_location_longitude_form_validate($element, &$form_state) {
  if (!empty($element['#value']) && (!is_numeric($element['#value']) || $element['#value'] < -180.0 || $element['#value'] > 180.0)) {
    form_error($element, t('Longitude must be a number between -180.0 and 180.0 (extrems included).'));
  }
}