<% form_remote_tag :url => comments_path(@article), :position => :bottom, :update => {:success => 'commentList'}, :loading => "loading()", :complete => "complete(request)", :failure => "failure(request)", :html => {:id => 'commentform', :class => 'comments' } \ do %>

Leave a comment

<%= text_field "comment", "author" %>

<%= text_field "comment", "email" %>

<%= text_field "comment", "url" %>

<%= submit_to_remote('preview', 'Preview!', :update => 'preview', :complete => "Element.show('preview')", :url => preview_new_comment_path(@article), :html => {:class => 'submit'}) %> <%= submit_tag 'Submit', :id => 'form-submit-button', :class => 'submit', :onclick => "$('commentform').onsubmit();this.disabled=true;Element.hide('preview');return false;" %> <%= image_tag '/images/theme/spinner.gif', :id => 'comment_loading', :style => 'display:none' %>

<% end %>