You are here

function gmap_dimension_validate in GMap Module 5

Same name and namespace in other branches
  1. 6.2 gmap.module \gmap_dimension_validate()
  2. 6 gmap.module \gmap_dimension_validate()
  3. 7.2 gmap.module \gmap_dimension_validate()
  4. 7 gmap.module \gmap_dimension_validate()

Ensure a textfield is a valid css dimension string.

File

./gmap.module, line 420
GMap -- Routines to use the Google Maps API in Drupal.

Code

function gmap_dimension_validate(&$elem) {
  $value = gmap_todim($elem['#value']);
  if ($value) {

    // Normalize the css dimension string.
    form_set_value($elem, $value);
  }
  else {
    form_error($elem, t('The specified value is not a valid CSS dimension.'));
  }
}