diff --git rules/ui/rules.autocomplete.js rules/ui/rules.autocomplete.js
index 5e46c3d..6597f2b 100644
--- rules/ui/rules.autocomplete.js
+++ rules/ui/rules.autocomplete.js
@@ -125,7 +125,19 @@ Drupal.rules = Drupal.rules || {};
     };
 
     this.button.click(function() {
-      instance.toggle();
+      if (instance.jqObject.autocomplete("widget").is(":visible")) {
+        instance.close();
+      }
+      else {
+        var groups = instance.jqObject.val().split(":");
+        var selector = "";
+        for (var i=0; i<groups.length-1; i++) {
+          selector = selector.concat(groups[i]) + ":";
+        }
+        
+        instance.jqObject.val(selector + groups[groups.length-1]);
+        instance.open(selector);
+      }
     });
   };
 
@@ -146,9 +158,12 @@ Drupal.rules = Drupal.rules || {};
 
   /**
    * Open the autocomplete window.
+   * @param searchFor The term for will be searched for. If undefined then the
+   *                  entered input text will be used. 
    */
-  Drupal.rules.autocomplete.prototype.open = function() {
-    this.jqObject.autocomplete("search", this.jqObject.val());
+  Drupal.rules.autocomplete.prototype.open = function(searchFor) {
+    // If searchFor is undefined, we want to search for the passed argument.
+    this.jqObject.autocomplete("search", ((searchFor === undefined) ? this.jqObject.val() : searchFor));
     this.button.addClass("ui-state-focus");
     this.groupSelected = false;
   };
