Be sure to clear the hidden tag form field as well
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 7 Apr 2009 17:43:39 +0000 (13:43 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 7 Apr 2009 17:44:12 +0000 (13:44 -0400)
kronolith/js/src/taggerAutoCompleter.js

index 34c8847..4b08026 100644 (file)
@@ -28,7 +28,7 @@ var KronolithTagger = Class.create({
             new Ajax.Autocompleter(params.trigger, params.resultsId, params.uri, params.params);
 
             // Prepopulate the tags and the container elements?
-            if (this.p.existing) {
+            if (typeof this.p.existing != 'undefined') {
                 this.init(this.p.existing);
             }
 
@@ -42,6 +42,9 @@ var KronolithTagger = Class.create({
                 $('kronolithTagACBox').select('li.kronolithTagACListItem').each(function(item) {this.removeTagNode(item) }.bind(this));
             }
 
+            // Clear the hidden tags field
+            $(this.p.tags).value = '';
+
             // Add any initial values
             if (typeof existing != 'undefined' && existing.length) {
                 for (var i = 0, l = existing.length; i < l; i++) {