I am trying to have a page submit a form and have the result update a
div instead of reloading the page, but everything I try refreshes the
page. I thought the :update part would prevent a page refresh, but
perhaps I am leaving something out.
Here is an example of something I have tried:
It's proabably not relevant, but the preferred way to do this is now
<% form_remote_tag :url => { :action => :enter }, :update =>
"position#{box_num}" do %>
<!-- form fields here -->
<%= submit_tag %>
<% end %>
I tried something close to that at one point. The example I saw had
dashes before the closing %>'s and I think it had <%='s for the
opening tags. I have updated my code to the preferred way you
describe, but it is still doing the same thing.
Does your page/layout include prototype?
This shows up in the page.
<script src="/javascripts/prototype.js?1207561014" type="text/
javascript"></script>
And the file is there, so it should be getting it.
I see the "return false" there in the javascript, which should at
least prevent it from submitting the form in the ordinary manner.
It probably means that the code before the return false is raising an
exception. Installing firebug or similar should help you out. This
would happen for example if there was no div with id position8
I have heard about firebug, but have never used it. It looks like it
would be useful, thanks. Here is what it said:
element.dispatchEvent is not a function
http://127.0.0.1:3000/javascripts/prototype.js?1207561014
Line 3972
fire([Document pedigree], "dom:loaded", undefined)prototype.js (line
3972)
_methodized()prototype.js (line 246)
fireContentLoadedEvent()prototype.js (line 4006)
[Break on this error] element.dispatchEvent(event);
I will try to step through it unless some has any ideas
I have heard about firebug, but have never used it. It looks like it
would be useful, thanks. Here is what it said:
element.dispatchEvent is not a function
http://127.0.0.1:3000/javascripts/prototype.js?1207561014
Line 3972
fire([Document pedigree], "dom:loaded", undefined)prototype.js (line
3972)
_methodized()prototype.js (line 246)
fireContentLoadedEvent()prototype.js (line 4006)
[Break on this error] element.dispatchEvent(event);
I will try to step through it unless some has any ideas