I''m new to rjs and ajax...doing the example in RJS Templates for
rails.
I''d like to submit the form onChange...but my onChange code
doesn''t
work as expected. I get the js code in the browser window..instead of
my updated page.
It does still work when I press the submit button though.
My form code:
<%= form_remote_tag :url => {:action => ''log''},
:html => { :id =>
''thought-form''} %>
<%= text_field_tag ''thought'', nil, {:size => 40,
:onChange =>
''this.form.submit()''} %>
<%= submit_to_remote ''Log thought'',
''Check'' %>
</form>
This is what I see in the browser.
try {
new Insertion.Top("thoughts", "<p>\n\ta random
thought\n</p>");
new Effect.Highlight("thoughts",{});
Form.reset("thought-form");
} catch (e) { alert(''RJS error:\n\n'' + e.toString());
alert(''new
Insertion.Top(\"thoughts\", \"<p>\\n\\tchris.ca
EXIST\\n</p>\");\nnew
Effect.Highlight(\"thoughts\",{});\nForm.reset(\"thought-form\");'');
throw e }
Any Ideas?
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---