I''m using update_field to update a <div> with the contents of a text_area as it''s updated by the user (a-la-Typo preview style). I''m now trying to preload the <div> so that it shows the contents of the field being edited even if that field doesn''t get edited. In other words, update_field is only called if the field is updated, but I want the same <div> to show the contents of the field even if the user doesn''t edit the field (the reason being that the <div> is the textilized contents of the field). So my idea was to have another <div> with the field contents, and then remove or clear that <div> when the update_field is called (so it isn''t displayed twice). so in my rhtml file I have: # this div is preloaded with field contents <div id="pre_preview" class="post"><%= textilize(@song_words_chords) %></div> # this div is updated by update_field <div id="preview" class="post"></div> <%= observe_field "song_words_chords", :frequency => 1, :update => "preview", :url => { :action => "preview" }, :with => "''song_words_chords='' + escape(value)" %> then in my preview.rhtml, which is called by the preview action (which updates the contents of @song_words_chords, I have: <p><%= update_element_function("pre_preview", { :action => :empty }) %> <p><%= textilize(@song_words_chords) %></p> But instead of emptying the "pre_preview" div, update_element_function just displays the following on the page: $(''pre_preview'').innerHTML = ''''; Does update_element_function only work on div''s defined in the same rhtml file? Or am I misusing it? I have a feeling I''m using an altogether incorrect approach for this anyway, but being new to both Rails and JS I''m not sure what the correct approach would be. Any advice would be appreciated. Thanks! -- Posted via http://www.ruby-forum.com/.