I’ve set up an observer form, it is not working nor throwing error at least in loading the page. The Firefox javascript console is showing this error:
Error: missing } after property list Source File: http://localhost:3000/ajaxsearch/list Line: 165, Column: 45 Source Code: hide(‘roller’)}, parameters:‘Form.serialize(‘asearch’)=’ + value})})
I think it’s telling me I’m missing a { (brace) , though I’m not 100% sure about that. The page source for the javascript it points too is:
new Form.Observer(‘asearch’, 1, function(element, value) {Element.show(‘roller’); new Ajax.Updater(‘table’, ‘/ajaxsearch/list’, {asynchronous:true, evalScripts:true, onComplete:function(request){Element.show(‘table’)}, onSuccess:function(request){ Element.hide(‘roller’)}, parameters:‘Form.serialize(‘asearch’)=’ + value})})
The page is loading the partial but is not effected by any of the options selected in the form. Not sure what is wrong , but here is the form and observe_form as it’s written:
<% start_form_tag(:action => “livesearch”, :id => “asearch”) %>
<%= submit_tag ‘livesearch’ %> <% end_form_tag %>
<%= image_tag(“roller.gif”, :align => ‘absmiddle’, :border => 0, :id => “roller”, :style => “display: none;”) %>
<%= observe_form “asearch”, :frequency => 1, :before => “Element.show(‘roller’)”, :success => “Element.hide (‘roller’)”, :with => “Form.serialize(‘asearch’)”, :complete => “Element.show(‘table’)”, :url => { :action => ‘list’ } %>