Auto_complete_field, :on_hide woes

Hi,
I have auto_complete working generating a list and populating a text
box in a form. The problem arises when I add the :on_hide option as
follows:

<%= auto_complete_field “search”,
{ :url => {:action => “search”}, :on_hide => “foo($(‘selected_uid’),
$(‘search_list’))”} > %>

:on_hide makes everything stop working (‘search’ action doesn’t get
called); in addition, the div that is supposed to contain the
selection list becomes visible beneath the text box as an ugly grey
bar.

Also, the javascript in the on_hide parameter gets executed on page
load; why is that?

Here’s the generated html for the form:

Search by surname:
 <script type="text/javascript">

//

Anyone have some working auto_complete_field code that uses :on_hide
(or :on_show) that they could share?

Thanks!
jh

James H.
Web application developer
Centre for Health Services and Policy Research
Vancouver, BC

“Developing a coherent political analysis is in many respects
contingent upon an ability to connect one context to another, a
process not dissimilar to playing the kid’s game of dot-to-dot.”

  • Ward Churchill, from ‘“A Government of Laws”?’