diff --git a/addressfield.module b/addressfield.module old mode 100644 new mode 100755 index 177d92b..1a92fc3 --- a/addressfield.module +++ b/addressfield.module @@ -508,7 +508,12 @@ function addressfield_standard_widget_refresh($form, $form_state) { // Return the address block, but remove the '_weight' element inserted // by the field API. unset($element['_weight']); - return $element; + + // Replace wrapper with new form and focus on country select + $commands[] = ajax_command_insert(NULL, render($element)); + $commands[] = ajax_command_invoke('#' . $element['country']['#id'], 'focus'); + + return array('#type' => 'ajax', '#commands' => $commands); } /**