You are here

function gmap_dimension_validate in GMap Module 6

Same name and namespace in other branches
  1. 5 gmap.module \gmap_dimension_validate()
  2. 6.2 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.

1 string reference to 'gmap_dimension_validate'
gmap_elements in ./gmap.module
Implementation of hook_elements().

File

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

Code

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

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