I have this form that allows a user to enter a username and save it,
assocciating your profile with theirs via an id. A list gets updated and
a partial is displayed. The problem is that when I hit the submit button
to this form to make this all happened I (sometimes, but more often then
not) get an RJS error that reads:
TypeError: Cannot set property ‘innerHTML’ of bull.
I hot OK and another error pops up giving me this long string of what
appears to be JavaScript or Ajax code?
Main View Code:
Travel Arranger Pages
The profiles for which you are responsible
<%= render :partial => 'show_my_users' %>
<%= render :partial => 'add_new_profile' %>
Partial - add_new_profile:
<% form_remote_tag :url => {:action => ‘add_profile_auto’, :id => @user.id },
:complete => “new Effect.Appear(‘airport’); new
Effect.Pulsate(‘airport’);”
do -%> Type in username to add to your list:
On Mon, 2009-04-20 at 19:26 +0200, Shandy N. wrote:
I have this form that allows a user to enter a username and save it,
assocciating your profile with theirs via an id. A list gets updated and
a partial is displayed. The problem is that when I hit the submit button
to this form to make this all happened I (sometimes, but more often then
not) get an RJS error that reads:
TypeError: Cannot set property ‘innerHTML’ of bull.
I hot OK and another error pops up giving me this long string of what
appears to be JavaScript or Ajax code?
I’ve never seen this myself but can offer some general info / advice.
In reverse order, yes. What you’re seeing in the error dialog is the
javascript that was being attempted when the error was encountered.
The fact that you’re getting a ‘TypeError’, and the error itself is
telling you that bull doesn’t have the property you’re trying to set.
It looks like you’re using replace_html on something that has no html
‘insides’. For example…
assuming:
<img id="bull" src="bull.png />
</div>
<p>this will work:<br>
page.replace_html “bull_ring”, “new_image.png”</p>
<p>this will not:<br>
page.replace_html “bull”, “new_image.png”</p>
<p>I’d start by taking a look at the HTML in Firebug prior to hitting the<br>
submit and compare what’s there with what you need wrt your RJS.</p>
<p>HTH,<br>
Bill</p>
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.