diff --git a/forms/TreeDropdownField.php b/forms/TreeDropdownField.php index e37da95e3..d0c521a0a 100755 --- a/forms/TreeDropdownField.php +++ b/forms/TreeDropdownField.php @@ -113,7 +113,7 @@ class TreeDropdownField extends FormField { array ( 'id' => "TreeDropdownField_{$this->id()}", 'class' => 'TreeDropdownField single' . ($this->extraClass() ? " {$this->extraClass()}" : ''), - 'href' => $this->Link(), + 'href' => $this->form ? $this->Link() : "", ), $this->createTag ( 'input', diff --git a/javascript/TreeSelectorField.js b/javascript/TreeSelectorField.js index ca50464ad..5b3cac7d3 100755 --- a/javascript/TreeSelectorField.js +++ b/javascript/TreeSelectorField.js @@ -60,6 +60,7 @@ TreeDropdownField.prototype = { // Build a URL from the field's base URL and the given sub URL buildURL: function(subURL) { var baseURL = jQuery(this).attr('href'); + if (!baseURL) baseURL = this.ownerForm().action + '/field/' + this.getName() + '/'; var subHasQuerystring = subURL.match(/\?/); if(baseURL.match(/^(.*)\?(.*)$/)) {