Hi, I''m having some scriptaculous weirdness, hoping this is an easy fix. I have a js function defined in my header: function flash(msg){ $(''flash_msg'').value = msg; alert(msg); // for debugging ... } This is being called like so: <%= form_remote_tag( :update => ''admins'', :url => { :action => ''add_admin'', :params => {:id => @place.id} }, :complete => "flash(''passes msg''); = \$(''add_field'').value = '''';" ) %> When I hit ''Add'' the correct div is updated, I see the alert (saying "passed message"), and ''add_field'' is cleared, but ''flash_msg'' never gets set. There are no js errors and I''m just totally stumped over why this could be. Thanks in advance for any help, pt. ------ Parker Thompson Professional (w) http://placesite.com (c) 510.541.0125
Parker Thompson wrote:> function flash(msg){ > $(''flash_msg'').value = msg; > alert(msg); // for debugging > > When I hit ''Add'' the correct div is updated, I see the alert (saying > "passed message"), and ''add_field'' is cleared, but ''flash_msg'' never > gets set. There are no js errors and I''m just totally stumped over why > this could be.What kind of HTML element has the flash_msg id? -- We develop, watch us RoR, in numbers too big to ignore.
On Fri, 16 Dec 2005, Mark Reginald James wrote: |What kind of HTML element has the flash_msg id? Ah, figured it out (thanks). I was trying to replace the contents of a div (also tried a span) using .value. Switching to innerHTML, e.g.: $(''flash_msg'').innerHTML = msg; fixed the problem. I knew it had to be something silly, just needed my assumptions questioned, thanks. pt.