--- ./geoparser.module	2010-03-06 14:03:17.000000000 -0700
+++ geoparser.validation	2010-06-21 17:07:31.000000000 -0600
@@ -228,6 +228,32 @@ function geoparser_form(&$form_state, $n
   
 }
 
+/**
+ * Validates location field settings for the geoparsing form
+ *
+ * @param string $form
+ * @param string $form_state
+ * @return void
+ * @author Andrew Lasda
+ */
+function geoparser_form_validate($form, &$form_state){
+  $node = node_load($form_state['values']['nid']);
+  $location_field_def = content_fields(variable_get('geoparse_location_' . $node->type, 0));
+  $name_field_def = content_fields(variable_get('geoparse_name_' . $node->type, 0));
+  $id_field_def = content_fields(variable_get('geoparse_id_' . $node->type, 0));
+  $geo_vals = 0;
+  foreach ($form_state['values'] as $key => $value ) {
+    if (preg_match('/geoparser_place_/', $key) && $value == 1) {
+      $geo_vals += 1;
+    }
+  }
+  if ((($location_field_def['required'] > 0) || ($name_field_def['required'] > 0) || ($id_field_def['required'] > 0)) && ($geo_vals == 0)){
+    form_set_error('', t('At least one Geoparsed Location value must be selected.'));
+  }
+  elseif($field_arr['multiple'] < $geo_vals){
+    form_set_error('', t('You may select only ' . $field_arr['multiple'] . ' Geoparsed Locations for this content/field type.'));
+  }
+}
 
 
 /**
@@ -557,4 +583,4 @@ function geoparser_geoparse_action($obje
   
   _geoparser_geoparse_single_node($object);
 
-}
\ No newline at end of file
+}
