You are here

function gmap_dimension_validate in GMap Module 7

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

Ensure a textfield is a valid css dimension string.

1 string reference to 'gmap_dimension_validate'
gmap_element_info in ./gmap.module
Implement hook_element_info().

File

./gmap.module, line 499
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.'));
  }
}