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") %>
<div id="parta">
<fieldset><legend>Category</legend>
<select name=position[category_id][] size = "4" multiple =
"multiple" id
''cat''><%options_from_collection_for_select @categories,
:id, :name
%></select></fieldset>
<fieldset><legend>State</legend>
<select name=position[state_id][] size = "4" multiple =
"multiple" id
''stat''><%options_from_collection_for_select @states,
:id, :name
%></select></fieldset>
<fieldset><legend>Terms</legend>
<select name=position[term_id][] size = "4" multiple =
"multiple" id
''term''><%options_from_collection_for_select @terms, :id,
:name %></select></fieldset>
<fieldset><legend>Title</legend>
<input type="text" id="title"
name="position[title]" size="10" id =
''title''
/></fieldset>
<fieldset><legend>City</legend>
<input type="text" id="city"
name="position[city]" size="10" id =
''city''
/></fieldset>
<%= submit_tag ''livesearch'' %>
<% end_form_tag %>
</div>
<%= 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'' } %>
<div id="partb">
<div id="table">
<%= render :partial => ''positions_list'', :layout =>
false %>
</div>
</div>
--
http://en.wikipedia.org/wiki/Dark_ambient
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---
Hi there, Yup, you''ve got a syntax error in your javascript. You might try the Vinkman JS debugger for mozilla. Then you can trace it back to whatever generated that code. I didn''t check your code thoroughly, but it could be an escaping problem. starr --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Well I straightened the form and checked it in firebug so it looks well now. I think my problem right now is the params aren''t being passed correctly into the action. Maybe someone could help this clueless noob out and tell me what I''m doing wrong - This is one element in the form - <select name=position[category_id][] size = "4" multiple = "multiple" id ''cat''><%options_from_collection_for_select @categories, :id, :name %></select></fieldset> In the controller I passed params[:position][category_id] but it''s coming up nil.[] Thanks Stuart On 10/12/06, Starr <snhorne-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi there, > > Yup, you''ve got a syntax error in your javascript. You might try the > Vinkman JS debugger for mozilla. Then you can trace it back to whatever > generated that code. > > I didn''t check your code thoroughly, but it could be an escaping > problem. > > starr > > > > >-- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Never mind I got the params in correctly. My only problem is it''s not generating the partial anymore :) Stuart On 10/12/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Well I straightened the form and checked it in firebug so it looks well > now. I think my problem right now is the params aren''t being passed > correctly into the action. Maybe someone could help this clueless noob out > and tell me what I''m doing wrong - > > This is one element in the form - > <select name=position[category_id][] size = "4" multiple = "multiple" id > ''cat''><%> options_from_collection_for_select @categories, :id, :name > %></select></fieldset> > > In the controller I passed params[:position][category_id] but it''s coming > up nil.[] > > Thanks > Stuart > > > On 10/12/06, Starr < snhorne-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Hi there, > > > > Yup, you''ve got a syntax error in your javascript. You might try the > > Vinkman JS debugger for mozilla. Then you can trace it back to whatever > > generated that code. > > > > I didn''t check your code thoroughly, but it could be an escaping > > problem. > > > > starr > > > > > > > > > > > > > -- > http://en.wikipedia.org/wiki/Dark_ambient >-- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---