Index: location.module =================================================================== --- location.module (revision 2375) +++ location.module (working copy) @@ -1116,6 +1116,7 @@ $string = strtolower($string); $string = '/^'. $string .'/'; $matches = array(); + $codesonly = variable_get('location_province_autocomplete', 0); if (strpos($country, ',') !== FALSE) { // Multiple countries specified. @@ -1132,6 +1133,14 @@ if (!empty($provinces)) { while (list($code, $name) = each($provinces)) { if ($counter < 5) { + if ($codesonly) { + if (preg_match($string, strtolower($code))) { + $matches[$code] = $code; + ++$counter; + } + } + } + else { if (preg_match($string, strtolower($name))) { $matches[$name] = $name; ++$counter;