function gmap_dimension_validate in GMap Module 6.2
Same name and namespace in other branches
- 5 gmap.module \gmap_dimension_validate()
- 6 gmap.module \gmap_dimension_validate()
- 7.2 gmap.module \gmap_dimension_validate()
- 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 456 - 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.'));
}
}