customUpdateElement = function(selectedElement) {
  var value = '';
  var ac = page_tag_list_auto_completer;
  if (ac.options.select) {
    var nodes = $(selectedElement).select('.' + ac.options.select) || [];
    if(nodes.length>0) value = Element.collectTextNodes(nodes[0], ac.options.select);
  } else
    value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');

  var bounds = ac.getTokenBounds();
  if (bounds[0] != -1) {
    var newValue = ac.element.value.substr(0, bounds[0]);
    var whitespace = ac.element.value.substr(bounds[0]).match(/^\s+/);
    if (whitespace)
      newValue += whitespace[0];
    value = value.replace(/\(\d+\)$/, '').strip();
    ac.element.value = newValue + value + ac.element.value.substr(bounds[1]) + ', ';
  } else {
    ac.element.value = value;
  }
  ac.oldElementValue = ac.element.value;
  ac.element.focus();

  if (ac.options.afterUpdateElement)
    ac.options.afterUpdateElement(ac.element, selectedElement);
}