Fixed autofill ignoring existing ID for text box parent node. Note that autofill is still in a nonworking state.
authorDan
Sat, 19 Jul 2008 20:47:00 -0400
changeset 645 24f2fa13a2a0
parent 644 9e8d3d376aee
child 646 55363ed1099e
Fixed autofill ignoring existing ID for text box parent node. Note that autofill is still in a nonworking state.
includes/clientside/static/autofill.js
--- a/includes/clientside/static/autofill.js	Sat Jul 12 12:34:19 2008 -0400
+++ b/includes/clientside/static/autofill.js	Sat Jul 19 20:47:00 2008 -0400
@@ -32,12 +32,13 @@
     // inject our HTML wrapper
     var template = this.template.replace(new RegExp('--ID--', 'g'), element.id).replace(new RegExp('--CLASS--', 'g', fillclass));
     var wrapper = element.parentNode; // document.createElement('div');
-    wrapper.id = 'autofill_wrap_' + element.id;
+    if ( !wrapper.id )
+      wrapper.id = 'autofill_wrap_' + element.id;
     
     // a bunch of hacks to add a spry wrapper
     wrapper.innerHTML = template + wrapper.innerHTML;
     
-    var autosuggest = new Spry.Widget.AutoSuggest("autofill_wrap_" + element.id, element.id + '_region', window[ds_name], 'name', {loadFromServer: true, urlParam: 'userinput', hoverSuggestClass: 'row2', minCharsType: 3});
+    var autosuggest = new Spry.Widget.AutoSuggest(wrapper.id, element.id + '_region', window[ds_name], 'name', {loadFromServer: true, urlParam: 'userinput', hoverSuggestClass: 'row2', minCharsType: 3});
     var regiondiv = document.getElementById(element.id + '_region');
     regiondiv.style.position = 'absolute';
     regiondiv.style.top = top + 'px';