skaue
2006-Oct-19 09:23 UTC
[PATCH]Allow the autocompleter to save value to a hidden field
In order to have the autocompleter save a value back to a hidden field I propose the following patch/change: In controls.js, change the following lines: <code> if (this.options.select) { var nodes = document.getElementsByClassName(this.options.select, selectedElement) || []; if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); </code> to: <code> if (this.options.select) { if (this.options.hiddenField)$(this.options.hiddenField).value Element.collectTextNodesIgnoreClass(selectedElement, this.options.select); var nodes = document.getElementsByClassName(this.options.select, selectedElement) || []; if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); </code> this will allow in conjunction with the "select"-option the autocompleter to save the unselected text to a hidden field --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---